mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-08 00:00:41 -04:00
2.7 KiB
2.7 KiB
id, title, challengeType, forumTopicId, dashedName
| id | title | challengeType | forumTopicId | dashedName |
|---|---|---|---|---|
| 5900f3e81000cf542c50fefb | Problema 124: radicali ordinati | 1 | 301751 | problem-124-ordered-radicals |
--description--
Il radicale di n, rad(n), è il prodotto dei fattori distinti primi di n. Per esempio, 504 = 2^3 ×3^2 × 7, quindi rad(504) = 2 × 3 × 7 = 42.
Se calcoliamo rad(n) for 1 ≤ n ≤ 10,, quindi ordiniamo su rad(n), e ordiniamo su n se i valori dei radicali sono uguali, otteniamo:
| $non in ordine$ | $ordinato$ | ||||
| $n$ | $rad(n)$ | $n$ | $rad(n)$ | $k$ | |
| 1 | 1 | 1 | 1 | 1 | |
| 2 | 2 | 2 | 2 | 2 | |
| 3 | 3 | 4 | 2 | 3 | |
| 4 | 2 | 8 | 2 | 4 | |
| 5 | 5 | 3 | 3 | 5 | |
| 6 | 6 | 9 | 3 | 6 | |
| 7 | 7 | 5 | 5 | 7 | |
| 8 | 2 | 6 | 6 | 8 | |
| 9 | 3 | 7 | 7 | 9 | |
| 10 | 10 | 10 | 10 | 10 | |
Sia E(k) l'elemento $k$-simo nella colonna n ordinata; per esempio, E(4) = 8 e E(6) = 9. Se rad(n) è ordinato per 1 ≤ n ≤ 100000, trova E(10000).
--hints--
orderedRadicals() dovrebbe restituire 21417.
assert.strictEqual(orderedRadicals(), 21417);
--seed--
--seed-contents--
function orderedRadicals() {
return true;
}
orderedRadicals();
--solutions--
// solution required