login
A069002
Smallest integer d such that n^2 + (n-d)^2 is a prime number.
4
1, 1, 3, 1, 1, 5, 1, 5, 1, 5, 5, 1, 3, 1, 7, 5, 1, 3, 1, 11, 5, 1, 5, 1, 1, 5, 3, 13, 1, 1, 5, 1, 5, 1, 1, 5, 13, 5, 1, 7, 17, 1, 3, 7, 5, 17, 1, 3, 7, 1, 7, 3, 13, 13, 5, 5, 3, 5, 17, 1, 7, 5, 3, 3, 1, 7, 3, 29, 1, 1, 17, 1, 19, 11, 15, 5, 23, 5, 1, 7, 5, 1, 5, 1, 1, 5, 1, 9, 11, 1, 5, 11, 3, 3, 5, 7, 1
OFFSET
2,3
COMMENTS
The case n=1 makes no sense and is omitted. For even n, it seems that 2d < n except for n=4.
EXAMPLE
a(5)=1 because (5-1) is the largest integer less than 5 such that the sum of their squares (16+25) is a prime number.
MATHEMATICA
maxN=100; Table[d = 1; While[! PrimeQ[n^2 + (n - d)^2], d++]; d, {n, 2, maxN}]
CROSSREFS
Cf. A239390, A239391 (record values).
Sequence in context: A124738 A131086 A201669 * A245369 A076334 A348641
KEYWORD
easy,nonn
AUTHOR
T. D. Noe, Apr 02 2002
STATUS
approved