1.1 KiB
1.1 KiB
id, challengeType, title, forumTopicId, localeTitle
id | challengeType | title | forumTopicId | localeTitle |
---|---|---|---|---|
5900f5041000cf542c510016 | 5 | Problem 407: Idempotents | 302075 | Задача 407: Идемпотент |
Description
Наибольшее значение a такое, что a2 ≡ a mod 6 равно 4. Назовем M (n) наибольшим значением a <n таким, что a2 ≡ a (mod n). Итак, M (6) = 4.
Найти ΣM (n) для 1 ≤ n ≤ 107.
Instructions
Tests
tests:
- text: <code>euler407()</code> should return 39782849136421.
testString: assert.strictEqual(euler407(), 39782849136421);
Challenge Seed
function euler407() {
// Good luck!
return true;
}
euler407();
Solution
// solution required