mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-19 04:00:56 -04:00
1.0 KiB
1.0 KiB
id, title, challengeType, forumTopicId, dashedName
| id | title | challengeType | forumTopicId | dashedName |
|---|---|---|---|---|
| 5900f3ec1000cf542c50fefe | Problem 127: abc-hits | 1 | 301754 | problem-127-abc-hits |
--description--
n 的根数 rad(n) 是 n 的所有素数因子的积。 如 $504 = 2^3 × 3^2 × 7$,则 $rad(504) = 2 × 3 × 7 = 42$。
We shall define the triplet of positive integers (a, b, c) to be an abc-hit if:
GCD(a, b) = GCD(a, c) = GCD(b, c) = 1即 a、b、c 两两互质a < ba + b = crad(abc) < c
例如, (5, 27, 32) 为 abc-hit,因为:
GCD(5, 27) = GCD(5, 32) = GCD(27, 32) = 15 < 275 + 27 = 32rad(4320) = 30 < 32
可以发现 abc-hits 非常罕见,对于 $c < 1000$,只有 31 个 abc-hits,可得 $\sum{c} = 12523$。
求 c < 120000 时的 $\sum{c}$。
--hints--
abcHits() 应该返回 18407904。
assert.strictEqual(abcHits(), 18407904);
--seed--
--seed-contents--
function abcHits() {
return true;
}
abcHits();
--solutions--
// solution required