OFFSET
1,1
LINKS
FORMULA
EXAMPLE
7 and 11 are consecutive primes. 11-7 = 4 a square, so 11 is the second term in the table.
MATHEMATICA
Select[Table[Prime[n], {n, 2, 237}], IntegerQ[Sqrt[# - Prime[PrimePi[# - 1]]]] &] (* Jayanta Basu, Apr 23 2013 *)
nn = 500; ps = Prime[Range[nn]]; t = {}; Do[If[IntegerQ[Sqrt[ps[[n]] - ps[[n-1]]]], AppendTo[t, ps[[n]]]], {n, 2, nn}]; t (* T. D. Noe, Apr 23 2013 *)
Prime[#+1]&/@Flatten[Position[Differences[Prime[Range[250]]], _?(IntegerQ[ Sqrt[#]]&)]] (* Harvey P. Dale, May 08 2019 *)
PROG
(PARI) g(n) = for(x=2, n, if(issquare(prime(x)-prime(x-1)), print1(prime(x)", ")))
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, May 07 2006
STATUS
approved