cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A245659 Prime numbers P such that Q=2*P^2-1, R=2*Q^2-1, S=2*R^2-1 and T=2*S^2-1 are all prime numbers.

This page as a plain text file.
%I A245659 #43 Aug 10 2025 19:28:15
%S A245659 281683,496789,823421,1352753,1719217,6174109,8643149,9761051,9843529,
%T A245659 16191167,19132121,19745797,23490473,28457797,31820429,32860271,
%U A245659 36552277,37068569,43506569,44776981,46808903,55035047,55957807,67194403,75099137,83092897,86580421,89135089
%N A245659 Prime numbers P such that Q=2*P^2-1, R=2*Q^2-1, S=2*R^2-1 and T=2*S^2-1 are all prime numbers.
%C A245659 Subsequence of A106483.
%C A245659 For P = 496789, 83092897, 467014643, U=2*T^2-1 is also prime. [Corrected by _Jens Kruse Andersen_, Aug 21 2014]
%H A245659 Pierre CAMI, <a href="/A245659/b245659.txt">Table of n, a(n) for n = 1..140</a>
%e A245659 281683 is prime P.
%e A245659 Q=2*P^2-1 = 158690624977 is prime Q.
%e A245659 R=2*Q^2-1 = 50365428911181712501057 is prime R.
%e A245659 S=2*R^2-1 = 5073352858814597404058971422301788780452234497 is prime S.
%e A245659 T=2*S^2-1 = 51477818460084496601334991724899650493354568309112026195311592373475872924903206720553686017 is prime T.
%e A245659 U=2*T^2-1 is composite.
%t A245659 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 *)
%t A245659 Select[Prime[Range[52*10^5]],AllTrue[Rest[FoldList[2#^2-1&,{#,#,#,#,#}]],PrimeQ]&] (* _Harvey P. Dale_, Jan 13 2023 *)
%o A245659 (PFGW & SCRIPT)
%o A245659 SCRIPT
%o A245659 DIM i
%o A245659 DIM j
%o A245659 DIM k
%o A245659 DIM n,0
%o A245659 DIMS t
%o A245659 OPENFILEOUT myf,a(n).txt
%o A245659 LABEL loop1
%o A245659 SET n,n+1
%o A245659 SETS t,%d,%d\,;n;p(n)
%o A245659 PRP 2*p(n)^2-1,t
%o A245659 IF ISPRP THEN GOTO a
%o A245659 GOTO loop1
%o A245659 LABEL a
%o A245659 SET i,2*p(n)^2-1
%o A245659 PRP 2*i^2-1,t
%o A245659 IF ISPRP THEN GOTO b
%o A245659 GOTO loop1
%o A245659 LABEL b
%o A245659 SET j,2*i^2-1
%o A245659 PRP 2*j^2-1,t
%o A245659 IF ISPRP THEN GOTO c
%o A245659 GOTO loop1
%o A245659 LABEL c
%o A245659 WRITE myf,t
%o A245659 SET k,2*j^2-1
%o A245659 PRP 2*k^2-1
%o A245659 IF ISPRP THEN GOTO d
%o A245659 GOTO loop1
%o A245659 LABEL d
%o A245659 WRITE myf,t
%o A245659 GOTO loop1
%o A245659 (PARI)
%o A245659 f(x)=return(2*x^2-1)
%o A245659 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
%Y A245659 Cf. A106483.
%K A245659 nonn
%O A245659 1,1
%A A245659 _Pierre CAMI_, Jul 28 2014
%E A245659 More terms from _Derek Orr_, Jul 28 2014