OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
(7^2 - 3^2)/2 - 1 is 19. Therefore 3 is in the sequence.
(19^2 - 13^2)/2 + 1 is 97. Hence 13 is in the sequence.
MAPLE
Res:= NULL:
p:= 5: q:= 3:
count:= 0:
while count < 100 do
r:= q; q:= p; p:= nextprime(p);
v:= (p^2-r^2)/2;
if isprime(v+1) or isprime(v-1) then
count:= count+1; Res:= Res, r;
fi
od:
Res; # Robert Israel, Oct 03 2018
MATHEMATICA
Prime[Select[Range[140], PrimeQ[(Prime[ #+2]^2-Prime[ # ]^2)/2+1] || PrimeQ[(Prime[ # +2]^2-Prime[ # ]^2)/2-1] &]]
Select[Partition[Prime[Range[200]], 3, 1], AnyTrue[(#[[3]]^2-#[[1]]^2)/2+{1, -1}, PrimeQ]&][[All, 1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 28 2020 *)
CROSSREFS
KEYWORD
nonn,less
AUTHOR
J. M. Bergot, Jul 13 2007
EXTENSIONS
Edited and extended by Stefan Steinerberger, Jul 23 2007
STATUS
approved