- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2022-11-03T02:51:33+00:00","","")
*[[Problem 120:http://projecteuler.net/problem=120]] 「自乗で割った余り」 [#s0e47e37]
#author("2024-05-31T15:36:29+00:00","","")
*[[Problem 120:http://projecteuler.net/problem=120]] 「二乗で割った余り」 [#s0e47e37]
&tex{(a-1)^{n}+(a+1)^{n}}; を &tex{a^{2}}; で割った余りを r と定義する.
例えば, a=7, n=3 の時, r=42 である: &tex{6^{3}+8^{3}=728};≡ 42 mod 49.
n が変われば r も変わるが, a=7 の時 r の最大値 &tex{r_{max}}; は 42 であることがわかる.
3 ≤ a ≤ 1000 において, Σ &tex{r_{max}}; を求めよ.