fix(curriculum): clean-up Project Euler 121-140 (#42731)

* fix: clean-up Project Euler 121-140

* fix: corrections from review

Co-authored-by: Sem Bauke <46919888+Sembauke@users.noreply.github.com>

* fix: missing backticks

Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>

* fix: corrections from review

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>

* fix: missing delimiter

Co-authored-by: Sem Bauke <46919888+Sembauke@users.noreply.github.com>
Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>
Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
This commit is contained in:
gikf
2021-07-16 21:38:37 +02:00
committed by GitHub
parent dc3b2508e4
commit 7907f62337
20 changed files with 314 additions and 185 deletions

View File

@ -8,38 +8,32 @@ dashedName: problem-127-abc-hits
# --description--
The radical of n, rad(n), is the product of distinct prime factors of n. For example, 504 = 23 × 32 × 7, so rad(504) = 2 × 3 × 7 = 42.
The radical of $n$, $rad(n)$, is the product of distinct prime factors of $n$. For example, $504 = 2^3 × 3^2 × 7$, so $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 &lt; b
a + b = c
rad(abc) &lt; c
1. $GCD(a, b) = GCD(a, c) = GCD(b, c) = 1$
2. $a &lt; b$
3. $a + b = c$
4. $rad(abc) &lt; c$
For example, (5, 27, 32) is an abc-hit, because:
GCD(5, 27) = GCD(5, 32) = GCD(27, 32) = 1
1. $GCD(5, 27) = GCD(5, 32) = GCD(27, 32) = 1$
2. $5 &lt; 27$
3. $5 + 27 = 32$
4. $rad(4320) = 30 &lt; 32$
5 &lt; 27
It turns out that abc-hits are quite rare and there are only thirty-one abc-hits for $c &lt; 1000$, with $\sum{c} = 12523$.
5 + 27 = 32
rad(4320) = 30 &lt; 32
It turns out that abc-hits are quite rare and there are only thirty-one abc-hits for c &lt; 1000, with ∑c = 12523.
Find ∑c for c &lt; 120000.
Find $\sum{c}$ for $c &lt; 120000$.
# --hints--
`euler127()` should return 18407904.
`abcHits()` should return `18407904`.
```js
assert.strictEqual(euler127(), 18407904);
assert.strictEqual(abcHits(), 18407904);
```
# --seed--
@ -47,12 +41,12 @@ assert.strictEqual(euler127(), 18407904);
## --seed-contents--
```js
function euler127() {
function abcHits() {
return true;
}
euler127();
abcHits();
```
# --solutions--