Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #21 Sep 08 2022 08:46:09
%S 2,79,107,173,257,359,383,523,593,971,1493,1811,1867,2273,2357,3187,
%T 4111,4723,6389,7607,8101,8699,9473,11027,12157,12227,15017,16301,
%U 16987,18797,19801,19913,20071,20323,21313,22003,22307,23203,24229,24733,24859,24943
%N Prime numbers P such that 8*P^2-1 and 8*(8*P^2-1)^2-1 are also prime numbers.
%C Subsequence of A245639.
%C For P < 150000000 in this sequence, 8*(8*(8*P^2)^2-1)^2-1)^2-1 is composite.
%H Pierre CAMI, <a href="/A245674/b245674.txt">Table of n, a(n) for n = 1..10000</a>
%e 2 is prime, 8*2^2-1=31 is prime, 8*31^2-1=7687 is prime, so 2 is in the sequence.
%t f[n_]:=8 n^2 - 1; Select[Prime[Range[3000]], PrimeQ[f[#]]&&PrimeQ[f[f[#]]]&] (* _Vincenzo Librandi_, Sep 08 2014 *)
%o (PFGW & SCRIPT)
%o SCRIPT
%o DIM i
%o DIM j,0
%o DIM n,0
%o DIMS t
%o OPENFILEOUT myf,a(n).txt
%o LABEL loop1
%o SET j,j+1
%o SETS t,%d\ ;p(j)
%o SET i,8*p(j)^2-1
%o PRP i,t
%o IF ISPRP THEN GOTO a
%o GOTO loop1
%o LABEL a
%o SET i,8*i^2-1
%o PRP i,t
%o IF ISPRP THEN GOTO b
%o GOTO loop1
%o LABEL b
%o WRITE myf,t
%o GOTO loop1
%o (PARI)
%o f(x) = 8*x^2-1;
%o forprime(p=1,10^8,if(ispseudoprime(f(p)) && ispseudoprime(f(f(p))), print1(p,", "))) \\ _Derek Orr_, Jul 29 2014
%o (Magma) [p: p in PrimesUpTo(25000)| IsPrime(8*p^2-1)and IsPrime(512*p^4-128*p^2+7)]; // _Vincenzo Librandi_, Sep 08 2014
%Y Cf. A245639.
%K nonn,easy
%O 1,1
%A _Pierre CAMI_, Jul 29 2014