Files
freeCodeCamp/curriculum/challenges/japanese/10-coding-interview-prep/project-euler/problem-123-prime-square-remainders.md
2022-01-20 20:30:18 +01:00

921 B
Raw Permalink Blame History

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
5900f3e71000cf542c50fefa 問題 123: 素数の平方数で除した余り 5 301750 problem-123-prime-square-remainders

--description--

n 番目の素数 (2, 3, 5, 7, 11, ...) を p_n とし、{(p_n1)}^n + {(p_n+1)}^n{p_n}^2 で除した余りを r とします。

例えば、n = 3 のとき、p_3 = 5, 4^3 + 6^3 = 280 ≡ 5\\ mod\\ 25 となります。

余りが初めて 10^9 を超える n の最小値は 7037です。

余りが初めて 10^{10} を超える n の最小値を求めなさい。

--hints--

primeSquareRemainders()21035 を返す必要があります。

assert.strictEqual(primeSquareRemainders(), 21035);

--seed--

--seed-contents--

function primeSquareRemainders() {

  return true;
}

primeSquareRemainders();

--solutions--

// solution required