Matlab code for PRIME SQUARE REMAINDER
古いコメントを表示
Let pn be the nth prime: 2, 3, 5, 7, 11, ..., and let r be the remainder when
is divided by
.
For example, when n = 3, p3 = 5, and
= 280 ≡ 5 mod 25.
= 280 ≡ 5 mod 25.The least value of n for which the remainder first exceeds
is 7037.
Find the least value of n for which the remainder first exceeds
.
5 件のコメント
Walter Roberson
2019 年 11 月 19 日
You accidentally forgot to ask a question.
David Goodmanson
2019 年 11 月 19 日
編集済み: David Goodmanson
2019 年 11 月 20 日
Hi Yattin,
It would be much more understandable if you edited your question so that it said
remainder of [ (p(n)-1)^n + (p(n)+1)^n ] / p(n)^n
or something similar. Is there a number-theoretic significance to this quantity?
Walter Roberson
2019 年 11 月 20 日
hint: powermod()
David Goodmanson
2019 年 11 月 20 日
thanks Walter, and could you change it to p_n on the second line?
Walter Roberson
2019 年 11 月 20 日
Done.
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Number Theory についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!