mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-13 13:00:15 -04:00
890 B
890 B
id, title, challengeType, forumTopicId, dashedName
| id | title | challengeType | forumTopicId | dashedName |
|---|---|---|---|---|
| 5900f5041000cf542c510016 | Задача 407: Ідемпотентні елементи | 1 | 302075 | problem-407-idempotents |
--description--
Якщо обчислити a^2\bmod 6 для 0 ≤ a ≤ 5 ми отримаємо: 0, 1, 4, 3, 4, 1.
Найбільше значення a^2 ≡ a\bmod 6 становить 4.
Назвімо M(n) найбільшим значенням a < n так, що a^2 ≡ a (\text{mod } n). Отже, M(6) = 4.
Знайдіть \sum M(n) для 1 ≤ n ≤ {10}^7.
--hints--
idempotents() повинен повертатися як 39782849136421.
assert.strictEqual(idempotents(), 39782849136421);
--seed--
--seed-contents--
function idempotents() {
return true;
}
idempotents();
--solutions--
// solution required