OFFSET
1,1
COMMENTS
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
MATHEMATICA
s={}; Do[If[PrimeQ[m=(n^2+1)/2] && PrimeQ[p=(m^2+1)/2] && PrimeQ[q=(p^2+1)/2], Print[n]; AppendTo[s, n]], {n, 1, 300000, 2}]; s
mpqQ[n_]:=Module[{m=(n^2+1)/2, p}, p=(m^2+1)/2; AllTrue[{m, p, (p^2+1)/2}, PrimeQ]]; Select[Range[144700], mpqQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 18 2021 *)
PROG
(Magma) r:=func< k | (k^2+1) div 2 >; [ n: n in [1..145000 by 2] | IsPrime(r(n)) and IsPrime(r(r(n))) and IsPrime(r(r(r(n)))) ]; // Bruno Berselli, Apr 05 2011
(PARI) v=vector(10^4); i=0; forstep(n=1, 9e9, 2, if(isprime(m=(n^2+1)/2)&isprime(p=(m^2+1)/2)&isprime(q=(p^2+1)/2), v[i++]=n; if(i==#v, return(v)))) \\ Charles R Greathouse IV, Apr 05 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Apr 03 2011
STATUS
approved