OFFSET
1,1
COMMENTS
Subsequence of A106483.
For P = 496789, 83092897, 467014643, U=2*T^2-1 is also prime. [Corrected by Jens Kruse Andersen, Aug 21 2014]
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..140
EXAMPLE
281683 is prime P.
Q=2*P^2-1 = 158690624977 is prime Q.
R=2*Q^2-1 = 50365428911181712501057 is prime R.
S=2*R^2-1 = 5073352858814597404058971422301788780452234497 is prime S.
T=2*S^2-1 = 51477818460084496601334991724899650493354568309112026195311592373475872924903206720553686017 is prime T.
U=2*T^2-1 is composite.
MATHEMATICA
f[n_]:=2n^2-1; Select[Prime[Range[5170000]], PrimeQ[f[#]]&&PrimeQ[f[f[#]]]&&PrimeQ[f[f[f[#]]]]&&PrimeQ[f[f[f[f[#]]]]]&] Farideh Firoozbakht, Aug 11 2014
Select[Prime[Range[52*10^5]], AllTrue[Rest[FoldList[2#^2-1&, {#, #, #, #, #}]], PrimeQ]&] (* Harvey P. Dale, Jan 13 2023 *)
PROG
(PFGW & SCRIPT)
SCRIPT
DIM i
DIM j
DIM k
DIM n, 0
DIMS t
OPENFILEOUT myf, a(n).txt
LABEL loop1
SET n, n+1
SETS t, %d, %d\,; n; p(n)
PRP 2*p(n)^2-1, t
IF ISPRP THEN GOTO a
GOTO loop1
LABEL a
SET i, 2*p(n)^2-1
PRP 2*i^2-1, t
IF ISPRP THEN GOTO b
GOTO loop1
LABEL b
SET j, 2*i^2-1
PRP 2*j^2-1, t
IF ISPRP THEN GOTO c
GOTO loop1
LABEL c
WRITE myf, t
SET k, 2*j^2-1
PRP 2*k^2-1
IF ISPRP THEN GOTO d
GOTO loop1
LABEL d
WRITE myf, t
GOTO loop1
(PARI)
f(x)=return(2*x^2-1)
forprime(p=1, 10^8, if(ispseudoprime(f(p)) && ispseudoprime(f(f(p))) && ispseudoprime(f(f(f(p)))) && ispseudoprime(f(f(f(f(p))))), print1(p, ", "))) \\ Derek Orr, Jul 28 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jul 28 2014
EXTENSIONS
More terms from Derek Orr, Jul 28 2014
STATUS
approved