← Complete problem index

PROJECT EULER · #0123

Prime Square Remainders

Statement only · SolvedOriginal problem ↗

Let pn be the nth prime: 2,3,5,7,11,, and let r be the remainder when (pn1)n+(pn+1)n is divided by pn2.

For example, when n=3, p3=5, and 43+63=2805mod25.

The least value of n for which the remainder first exceeds 109 is 7037.

Find the least value of n for which the remainder first exceeds 1010.

Write-up coming later

The complete problem is available here. An approach, code, and answer will be added later.