OFFSET
1,1
COMMENTS
The primes p and q have the smallest difference and the shortest distance on the 2-dimensional plane. Primes p = a^2 + (a-1)^2 == 13 (mod 100) and q = (a+1)^2 + (a-2)^2 == 17 (mod 100), where natural a == 3 (mod 5).
LINKS
David W. Wilson, Table of n, a(n) for n = 1..1000
FORMULA
MATHEMATICA
isP[p_, p1_List, p2_List] := Module[{q = Sort[Abs[p1 + p2]], s}, s = q[[1]]^2 + q[[2]]^2; q != p1 && s - p == 4 && PrimeQ[s]]; testQ[p_] := Module[{pp = PowersRepresentations[p, 2, 2][[1]]}, isP[p, pp, {-1, -1}] || isP[p, pp, {-1, 1}] || isP[p, pp, {1, -1}] || isP[p, pp, {1, 1}]]; Select[Prime[Range[200000]], Mod[#, 4] == 1 && testQ[#] &] (* T. D. Noe, Oct 19 2012 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Thomas Ordowski, Oct 10 2012
EXTENSIONS
Extended by T. D. Noe, Oct 19 2012
STATUS
approved