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

861 B
Raw Permalink Blame History

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
5900f3e41000cf542c50fef7 問題 120: 平方数で除した余り 5 301747 problem-120-square-remainders

--description--

{(a 1)}^n + {(a + 1)}^na^2 で除した余りを r とします。

例えば、a = 7 かつ n = 3 のとき、r = 42: 6^3 + 8^3 = 728 ≡ 42 \\ \text{mod}\\ 49 です。 n が変わると r も変わりますが、a = 7 のときに r_{max} = 42 となります。

3 ≤ a ≤ 1000 のとき、\sum{r}_{max} を求めなさい。

--hints--

squareRemainders()333082500 を返す必要があります。

assert.strictEqual(squareRemainders(), 333082500);

--seed--

--seed-contents--

function squareRemainders() {

  return true;
}

squareRemainders();

--solutions--

// solution required