OFFSET
1,1
COMMENTS
Note that sqrt(p2-p1), sqrt(p3-p2), sqrt(p3-p1) form a Pythagorean triple. [corrected by James R. Buddenhagen, Jul 09 2013]
Gap pairs p1-p2, p3-p2 occur as 36,64, or 64,36 at least through a(n) <= 10^8.
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
EXAMPLE
623071 is the smallest of the consecutive primes 623071, 623107, and 623171 with gaps 623107-623071 = 36, 623171-623107 = 64, and the double gap 623171-623071 = 100 each a perfect square.
MATHEMATICA
PerfectSquareQ[n_] := JacobiSymbol[n, 13] =!= -1 && JacobiSymbol[n, 19] =!= -1 && JacobiSymbol[n, 17] =!= -1 && JacobiSymbol[n, 23] =!= -1 && IntegerQ[Sqrt[n]]; t = {}; n = 2; p1 = 1; p2 = 2; p3 = 3; While[Length[t] < 30, n++; p1 = p2; p2 = p3; p3 = Prime[n]; If[PerfectSquareQ[p2 - p1] && PerfectSquareQ[p3 - p2] && PerfectSquareQ[p3 - p1], AppendTo[t, p1]]]; t (* T. D. Noe, Jul 09 2013 *)
psQ[{a_, b_, c_}]:=AllTrue[{Sqrt[b-a], Sqrt[c-b], Sqrt[c-a]}, IntegerQ]; Transpose[ Select[Partition[ Prime[Range[600000]], 3, 1], psQ]][[1]] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Aug 20 2014 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Ki Punches, Jun 13 2009
EXTENSIONS
5710567 inserted by R. J. Mathar, Sep 23 2009
STATUS
approved