fix(curriculum): clean-up Project Euler 241-260 (#42879)
* fix: clean-up Project Euler 241-260 * fix: typo * Update curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-255-rounded-square-roots.md Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
This commit is contained in:
@ -8,16 +8,24 @@ dashedName: problem-245-coresilience
|
||||
|
||||
# --description--
|
||||
|
||||
We shall call a fraction that cannot be cancelled down a resilient fraction. Furthermore we shall define the resilience of a denominator, R(d), to be the ratio of its proper fractions that are resilient; for example, R(12) = 4⁄11.
|
||||
We shall call a fraction that cannot be cancelled down a resilient fraction.
|
||||
|
||||
The resilience of a number d > 1 is then φ(d)d − 1 , where φ is Euler's totient function. We further define the coresilience of a number n > 1 as C(n)= n − φ(n)n − 1. The coresilience of a prime p is C(p) = 1p − 1. Find the sum of all composite integers 1 < n ≤ 2×1011, for which C(n) is a unit fraction.
|
||||
Furthermore we shall define the resilience of a denominator, $R(d)$, to be the ratio of its proper fractions that are resilient; for example, $R(12) = \frac{4}{11}$.
|
||||
|
||||
The resilience of a number $d > 1$ is then $\frac{φ(d)}{d − 1}$ , where $φ$ is Euler's totient function.
|
||||
|
||||
We further define the coresilience of a number $n > 1$ as $C(n) = \frac{n − φ(n)}{n − 1}$.
|
||||
|
||||
The coresilience of a prime $p$ is $C(p) = \frac{1}{p − 1}$.
|
||||
|
||||
Find the sum of all composite integers $1 < n ≤ 2 × {10}^{11}$, for which $C(n)$ is a unit fraction.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler245()` should return 288084712410001.
|
||||
`coresilience()` should return `288084712410001`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler245(), 288084712410001);
|
||||
assert.strictEqual(coresilience(), 288084712410001);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -25,12 +33,12 @@ assert.strictEqual(euler245(), 288084712410001);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler245() {
|
||||
function coresilience() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler245();
|
||||
coresilience();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
Reference in New Issue
Block a user