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:
@ -10,14 +10,24 @@ dashedName: problem-126-cuboid-layers
|
||||
|
||||
The minimum number of cubes to cover every visible face on a cuboid measuring 3 x 2 x 1 is twenty-two.
|
||||
|
||||
If we then add a second layer to this solid it would require forty-six cubes to cover every visible face, the third layer would require seventy-eight cubes, and the fourth layer would require one-hundred and eighteen cubes to cover every visible face. However, the first layer on a cuboid measuring 5 x 1 x 1 also requires twenty-two cubes; similarly the first layer on cuboids measuring 5 x 3 x 1, 7 x 2 x 1, and 11 x 1 x 1 all contain forty-six cubes. We shall define C(n) to represent the number of cuboids that contain n cubes in one of its layers. So C(22) = 2, C(46) = 4, C(78) = 5, and C(118) = 8. It turns out that 154 is the least value of n for which C(n) = 10. Find the least value of n for which C(n) = 1000.
|
||||
<img class="img-responsive center-block" alt="3x2x1 cuboid covered by twenty-two 1x1x1 cubes" src="https://cdn.freecodecamp.org/curriculum/project-euler/cuboid-layers.png" style="background-color: white; padding: 10px;">
|
||||
|
||||
If we add a second layer to this solid it would require forty-six cubes to cover every visible face, the third layer would require seventy-eight cubes, and the fourth layer would require one-hundred and eighteen cubes to cover every visible face.
|
||||
|
||||
However, the first layer on a cuboid measuring 5 x 1 x 1 also requires twenty-two cubes; similarly, the first layer on cuboids measuring 5 x 3 x 1, 7 x 2 x 1, and 11 x 1 x 1 all contain forty-six cubes.
|
||||
|
||||
We shall define $C(n)$ to represent the number of cuboids that contain $n$ cubes in one of its layers. So $C(22) = 2$, $C(46) = 4$, $C(78) = 5$, and $C(118) = 8$.
|
||||
|
||||
It turns out that 154 is the least value of $n$ for which $C(n) = 10$.
|
||||
|
||||
Find the least value of $n$ for which $C(n) = 1000$.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler126()` should return 18522.
|
||||
`cuboidLayers()` should return `18522`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler126(), 18522);
|
||||
assert.strictEqual(cuboidLayers(), 18522);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -25,12 +35,12 @@ assert.strictEqual(euler126(), 18522);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler126() {
|
||||
function cuboidLayers() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler126();
|
||||
cuboidLayers();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
Reference in New Issue
Block a user