chore: migrate untranslated files (#44462)

This commit is contained in:
Nicholas Carrigan (he/him)
2021-12-10 07:58:00 -08:00
committed by GitHub
parent f8eec5d3fb
commit 010e09ffb7
18 changed files with 1694 additions and 0 deletions

View File

@ -0,0 +1,142 @@
---
id: 5900f3e81000cf542c50fefb
title: 'Problem 124: Ordered radicals'
challengeType: 5
forumTopicId: 301751
dashedName: problem-124-ordered-radicals
---
# --description--
The radical of $n$, $rad(n)$, is the product of the distinct prime factors of $n$. For example, $504 = 2^3 × 3^2 × 7$, so $rad(504) = 2 × 3 × 7 = 42$.
If we calculate $rad(n)$ for $1 ≤ n ≤ 10$, then sort them on $rad(n)$, and sorting on $n$ if the radical values are equal, we get:
<div style="text-align: center;">
<table cellpadding="2" cellspacing="0" border="0" align="center">
<tbody>
<tr>
<td colspan="2">$Unsorted$</td>
<td></td>
<td colspan="3">$Sorted$</td>
</tr>
<tr>
<td>$n$</td>
<td>$rad(n)$</td>
<td></td>
<td>$n$</td>
<td>$rad(n)$</td>
<td>$k$</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td></td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>2</td>
<td>2</td>
<td></td>
<td>2</td>
<td>2</td>
<td>2</td>
</tr>
<tr>
<td>3</td>
<td>3</td>
<td></td>
<td>4</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>4</td>
<td>2</td>
<td></td>
<td>8</td>
<td>2</td>
<td>4</td>
</tr>
<tr>
<td>5</td>
<td>5</td>
<td></td>
<td>3</td>
<td>3</td>
<td>5</td>
</tr>
<tr>
<td>6</td>
<td>6</td>
<td></td>
<td>9</td>
<td>3</td>
<td>6</td>
</tr>
<tr>
<td>7</td>
<td>7</td>
<td></td>
<td>5</td>
<td>5</td>
<td>7</td>
</tr>
<tr>
<td>8</td>
<td>2</td>
<td></td>
<td>6</td>
<td>6</td>
<td>8</td>
</tr>
<tr>
<td>9</td>
<td>3</td>
<td></td>
<td>7</td>
<td>7</td>
<td>9</td>
</tr>
<tr>
<td>10</td>
<td>10</td>
<td></td>
<td>10</td>
<td>10</td>
<td>10</td>
</tr>
</tbody>
</table>
</div><br>
Let $E(k)$ be the $k$th element in the sorted $n$ column; for example, $E(4) = 8$ and $E(6) = 9$. If $rad(n)$ is sorted for $1 ≤ n ≤ 100000$, find $E(10000)$.
# --hints--
`orderedRadicals()` should return `21417`.
```js
assert.strictEqual(orderedRadicals(), 21417);
```
# --seed--
## --seed-contents--
```js
function orderedRadicals() {
return true;
}
orderedRadicals();
```
# --solutions--
```js
// solution required
```

View File

@ -0,0 +1,75 @@
---
id: 5900f4341000cf542c50ff46
title: 'Problem 199: Iterative Circle Packing'
challengeType: 5
forumTopicId: 301837
dashedName: problem-199-iterative-circle-packing
---
# --description--
Three circles of equal radius are placed inside a larger circle such that each pair of circles is tangent to one another and the inner circles do not overlap. There are four uncovered "gaps" which are to be filled iteratively with more tangent circles.
<img class="img-responsive center-block" alt="a diagram of non-overlapping circles" src="https://cdn-media-1.freecodecamp.org/project-euler/199-circles-in-circles.gif" style="background-color: white; padding: 10px;">
At each iteration, a maximally sized circle is placed in each gap, which creates more gaps for the next iteration. After 3 iterations (pictured), there are 108 gaps and the fraction of the area which is not covered by circles is 0.06790342, rounded to eight decimal places.
What fraction of the area is not covered by circles after `n` iterations? Give your answer rounded to eight decimal places using the format x.xxxxxxxx .
# --hints--
`iterativeCirclePacking(10)` should return a number.
```js
assert(typeof iterativeCirclePacking(10) === 'number');
```
`iterativeCirclePacking(10)` should return `0.00396087`.
```js
assert.strictEqual(iterativeCirclePacking(10), 0.00396087);
```
`iterativeCirclePacking(3)` should return `0.06790342`.
```js
assert.strictEqual(iterativeCirclePacking(3), 0.06790342);
```
# --seed--
## --seed-contents--
```js
function iterativeCirclePacking(n) {
return true;
}
iterativeCirclePacking(10);
```
# --solutions--
```js
function iterativeCirclePacking(n) {
let k1 = 1;
let k0 = k1 * (3 - 2 * Math.sqrt(3));
let a0 = 1 / (k0 * k0);
let a1 = 3 / (k1 * k1);
a1 += 3 * getArea(k0, k1, k1, n);
a1 += getArea(k1, k1, k1, n);
let final = ((a0 - a1) / a0).toFixed(8);
return parseFloat(final);
function getArea(k1, k2, k3, depth) {
if (depth == 0) return 0.0;
let k4 = k1 + k2 + k3 + 2 * Math.sqrt(k1 * k2 + k2 * k3 + k3 * k1);
let a = 1 / (k4 * k4);
a += getArea(k1, k2, k4, depth - 1);
a += getArea(k2, k3, k4, depth - 1);
a += getArea(k3, k1, k4, depth - 1);
return a;
}
}
```

View File

@ -0,0 +1,48 @@
---
id: 5900f4881000cf542c50ff9a
title: >-
Problem 283: Integer sided triangles for which the area / perimeter ratio is integral
challengeType: 5
forumTopicId: 301934
dashedName: >-
problem-283-integer-sided-triangles-for-which-the-area--perimeter-ratio-is-integral
---
# --description--
Consider the triangle with sides 6, 8 and 10. It can be seen that the perimeter and the area are both equal to 24.
So the $\frac{\text{area}}{\text{perimeter}}$ ratio is equal to 1.
Consider also the triangle with sides 13, 14 and 15. The perimeter equals 42 while the area is equal to 84.
So for this triangle the $\frac{\text{area}}{\text{perimeter}}$ ratio is equal to 2.
Find the sum of the perimeters of all integer sided triangles for which the area/perimeter ratios are equal to positive integers not exceeding 1000.
# --hints--
`integralAreaPerimeterRatio()` should return `28038042525570324`.
```js
assert.strictEqual(integralAreaPerimeterRatio(), 28038042525570324);
```
# --seed--
## --seed-contents--
```js
function integralAreaPerimeterRatio() {
return true;
}
integralAreaPerimeterRatio();
```
# --solutions--
```js
// solution required
```

View File

@ -0,0 +1,86 @@
---
id: 5900f3891000cf542c50fe9c
title: 'Problem 29: Distinct powers'
challengeType: 5
forumTopicId: 301941
dashedName: problem-29-distinct-powers
---
# --description--
Consider all integer combinations of $a^b$ for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5:
<div style='padding-left: 4em;'>
2<sup>2</sup>=4, 2<sup>3</sup>=8, 2<sup>4</sup>=16, 2<sup>5</sup>=32 <br>
3<sup>2</sup>=9, 3<sup>3</sup>=27, 3<sup>4</sup>=81, 3<sup>5</sup>=243 <br>
4<sup>2</sup>=16, 4<sup>3</sup>=64, 4<sup>4</sup>=256, 4<sup>5</sup>=1024 <br>
5<sup>2</sup>=25, 5<sup>3</sup>=125, 5<sup>4</sup>=625, 5<sup>5</sup>=3125 <br>
</div>
If they are then placed in numerical order, with any repeats removed, we get the following sequence of 15 distinct terms:
<div style='padding-left: 4em;'>
4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125
</div>
How many distinct terms are in the sequence generated by $a^b$ for 2 ≤ `a``n` and 2 ≤ `b``n`?
# --hints--
`distinctPowers(15)` should return a number.
```js
assert(typeof distinctPowers(15) === 'number');
```
`distinctPowers(15)` should return 177.
```js
assert.strictEqual(distinctPowers(15), 177);
```
`distinctPowers(20)` should return 324.
```js
assert.strictEqual(distinctPowers(20), 324);
```
`distinctPowers(25)` should return 519.
```js
assert.strictEqual(distinctPowers(25), 519);
```
`distinctPowers(30)` should return 755.
```js
assert.strictEqual(distinctPowers(30), 755);
```
# --seed--
## --seed-contents--
```js
function distinctPowers(n) {
return n;
}
distinctPowers(30);
```
# --solutions--
```js
const distinctPowers = (n) => {
let list = [];
for (let a=2; a<=n; a++) {
for (let b=2; b<=n; b++) {
let term = Math.pow(a, b);
if (list.indexOf(term)===-1) list.push(term);
}
}
return list.length;
};
```

View File

@ -0,0 +1,52 @@
---
id: 5900f4b71000cf542c50ffca
title: 'Problem 331: Cross flips'
challengeType: 5
forumTopicId: 301989
dashedName: problem-331-cross-flips
---
# --description--
N×N disks are placed on a square game board. Each disk has a black side and white side.
At each turn, you may choose a disk and flip all the disks in the same row and the same column as this disk: thus $2 × N - 1$ disks are flipped. The game ends when all disks show their white side. The following example shows a game on a 5×5 board.
<img class="img-responsive center-block" alt="animation showing game on 5x5 board" src="https://cdn.freecodecamp.org/curriculum/project-euler/cross-flips.gif" style="background-color: white; padding: 10px;">
It can be proven that 3 is the minimal number of turns to finish this game.
The bottom left disk on the $N×N$ board has coordinates (0, 0); the bottom right disk has coordinates ($N - 1$,$0$) and the top left disk has coordinates ($0$,$N - 1$).
Let $C_N$ be the following configuration of a board with $N × N$ disks: A disk at ($x$, $y$) satisfying $N - 1 \le \sqrt{x^2 + y^2} \lt N$, shows its black side; otherwise, it shows its white side. $C_5$ is shown above.
Let $T(N)$ be the minimal number of turns to finish a game starting from configuration $C_N$ or 0 if configuration $C_N$ is unsolvable. We have shown that $T(5) = 3$. You are also given that $T(10) = 29$ and $T(1\\,000) = 395\\,253$.
Find $\displaystyle \sum_{i = 3}^{31} T(2^i - i)$.
# --hints--
`crossFlips()` should return `467178235146843500`.
```js
assert.strictEqual(crossFlips(), 467178235146843500);
```
# --seed--
## --seed-contents--
```js
function crossFlips() {
return true;
}
crossFlips();
```
# --solutions--
```js
// solution required
```