OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
a(1)=7 because (13^2 - 7^2)/2 - 1 = 59 and (13^2 - 7^2)/2 + 1 = 61 (59, 61 are both primes),
a(2)=19 because (29^2 - 19^2)/2 - 1 = 239 and (29^2 - 19^2)/2 + 1 = 241,
a(3)=37 because (43^2 - 37^2)/2 - 1 = 239 and (43^2 - 37^2)/2 + 1 = 241, ...
MAPLE
ts_p4:=proc(n) local a, b, i, ans; ans := [ ]: for i from 2 by 1 to n do a := (ithprime(i+2)^(2)-ithprime(i)^(2))/2-1: b := (ithprime(i+2)^(2)-ithprime(i)^(2))/2+1: if (isprime(a)=true and isprime(b)=true) then ans := [ op(ans), ithprime(i) ]: fi od; RETURN(ans) end: ts_p4(2000);
MATHEMATICA
Prime/@Select[Range[700], AllTrue[(Prime[#+2]^2-Prime[#]^2)/2+{1, -1}, PrimeQ]&] (* Harvey P. Dale, Nov 27 2022 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jani Melik, Aug 01 2007
STATUS
approved