← Complete problem index

PROJECT EULER · #0659

Largest Prime

Statement only · SolvedOriginal problem ↗

Consider the sequence n2+3 with n1.
If we write down the first terms of this sequence we get:
4,7,12,19,28,39,52,67,84,103,124,147,172,199,228,259,292,327,364, .
We see that the terms for n=6 and n=7 (39 and 52) are both divisible by 13.
In fact 13 is the largest prime dividing any two successive terms of this sequence.

Let P(k) be the largest prime that divides any two successive terms of the sequence n2+k2.

Find the last 18 digits of k=110000000P(k).

Write-up coming later

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