fix(curriculum): clean-up Project Euler 281-300 (#42922)
* fix: clean-up Project Euler 281-300 * fix: missing image extension * fix: missing power Co-authored-by: Tom <20648924+moT01@users.noreply.github.com> * fix: missing subscript Co-authored-by: Tom <20648924+moT01@users.noreply.github.com> Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
This commit is contained in:
@ -8,20 +8,22 @@ dashedName: problem-281-pizza-toppings
|
||||
|
||||
# --description--
|
||||
|
||||
You are given a pizza (perfect circle) that has been cut into m·n equal pieces and you want to have exactly one topping on each slice.
|
||||
You are given a pizza (perfect circle) that has been cut into $m·n$ equal pieces and you want to have exactly one topping on each slice.
|
||||
|
||||
Let f(m,n) denote the number of ways you can have toppings on the pizza with m different toppings (m ≥ 2), using each topping on exactly n slices (n ≥ 1). Reflections are considered distinct, rotations are not.
|
||||
Let $f(m,n)$ denote the number of ways you can have toppings on the pizza with $m$ different toppings ($m ≥ 2$), using each topping on exactly $n$ slices ($n ≥ 1$). Reflections are considered distinct, rotations are not.
|
||||
|
||||
Thus, for instance, f(2,1) = 1, f(2,2) = f(3,1) = 2 and f(3,2) = 16. f(3,2) is shown below:
|
||||
Thus, for instance, $f(2,1) = 1$, $f(2,2) = f(3,1) = 2$ and $f(3,2) = 16$. $f(3,2)$ is shown below:
|
||||
|
||||
Find the sum of all f(m,n) such that f(m,n) ≤ 1015.
|
||||
<img class="img-responsive center-block" alt="animation with 16 ways to have 3 different toppings on 2 slices each" src="https://cdn.freecodecamp.org/curriculum/project-euler/pizza-toppings.gif" style="background-color: white; padding: 10px;">
|
||||
|
||||
Find the sum of all $f(m,n)$ such that $f(m,n) ≤ {10}^{15}$.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler281()` should return 1485776387445623.
|
||||
`pizzaToppings()` should return `1485776387445623`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler281(), 1485776387445623);
|
||||
assert.strictEqual(pizzaToppings(), 1485776387445623);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -29,12 +31,12 @@ assert.strictEqual(euler281(), 1485776387445623);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler281() {
|
||||
function pizzaToppings() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler281();
|
||||
pizzaToppings();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
Reference in New Issue
Block a user