login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Primes p such that q=p^2-2 and r=q^2-2 are also prime.
3

%I #16 Sep 08 2022 08:46:12

%S 2,3,7,19,37,89,211,223,257,797,1021,1051,1153,1619,2087,2297,3299,

%T 3359,3709,3943,4093,4229,4349,4451,4621,5119,5209,5923,6323,6361,

%U 7229,7589,8731,8867,9127,9697,9721,9907,10009,10289,10729,11149,11437,11699,11933

%N Primes p such that q=p^2-2 and r=q^2-2 are also prime.

%C Primes p that remain prime under two iterations of the map p => p^2-2. Note that p=2 is a fixed point of this map.

%C First primes >2 that remain prime under three iterations of the map p => p^2-2, are 3, 3299, 6323, 9127, 9697, 26357 (A257552).

%H Robert Israel, <a href="/A257551/b257551.txt">Table of n, a(n) for n = 1..10000</a>

%e p=3, q=7, r=47 all prime,

%e p=7, q=47, r=2207 all prime,

%e p=19, q=359, r=128879 all prime.

%p filter:= proc(p) local q;

%p if not isprime(p) then return false fi;

%p q:= p^2-2;

%p isprime(q) and isprime(q^2-2)

%p end proc:

%p select(filter, [2,seq(i,i=3..20000,2)]); # _Robert Israel_, Oct 31 2019

%t Select[Prime@ Range@ 2000, PrimeQ[#^2 - 2] && PrimeQ[Nest[#^2 - 2 &, #, 2]] &] (* _Michael De Vlieger_, Apr 29 2015 *)

%t Select[Prime@Range@2000, PrimeQ[#^2 - 2] && PrimeQ[#^4 -4 #^2 + 2] &] (* _Vincenzo Librandi_, Apr 30 2015 *)

%o (Magma) [p: p in PrimesUpTo(15000)| IsPrime(p^4-4*p^2+2)and IsPrime(p^2-2)]; // _Vincenzo Librandi_, Apr 30 2015

%o (PARI) forprime(p=1,10^4,if(isprime(q=p^2-2)&&isprime(q^2-2),print1(p,", "))) \\ _Derek Orr_, Apr 30 2015

%Y Subsequence of A062326. A257552 is a subsequence.

%K nonn,easy

%O 1,1

%A _Zak Seidov_, Apr 29 2015

%E More terms from _Vincenzo Librandi_, Apr 30 2015