OFFSET
1,1
EXAMPLE
31^2 - 1 = 241^2 - 239^2, and (239, 241) is a twin prime pair, so 31 is in the sequence.
MATHEMATICA
lst={}; f[n_]:=Sqrt[Prime[n]^2-NextPrime[Prime[n], -1]^2+1];
Do[If[Prime[n]-NextPrime[Prime[n], -1]==2&&IntegerQ[f[n]], AppendTo[lst, f[n]]], {n, 3, 10^5}]; lst (* Ivan N. Ianakiev, Mar 30 2015 *)
PROG
(PARI) lista(nn) = {forprime(p=3, nn, q = precprime(p-1); if (((p-q) == 2) && issquare(d=p^2-q^2+1), print1(sqrtint(d), ", ")); ); } \\ Michel Marcus, Feb 18 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Neri Gionata, Feb 18 2015
STATUS
approved