login
Primes that remain prime through 2 iterations of function f(x) = 9x + 4.
4

%I #20 Sep 08 2022 08:44:47

%S 3,7,31,37,41,71,73,83,107,191,283,307,317,337,373,421,631,743,773,

%T 821,857,883,967,1283,1297,1361,1451,1567,1571,1637,1823,1973,2137,

%U 2207,2351,2417,2677,2683,2837,3011,3083,3271,3331,3517,3571,3691,3727,3793,3877

%N Primes that remain prime through 2 iterations of function f(x) = 9x + 4.

%C Primes p such that 9*p+4 and 81*p+40 are also primes. - _Vincenzo Librandi_, Aug 04 2010

%H Harvey P. Dale, <a href="/A023266/b023266.txt">Table of n, a(n) for n = 1..10000</a>

%t Select[Prime[Range[600]],AllTrue[Rest[NestList[9#+4&,#,2]],PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Jul 15 2016 *)

%o (Magma) [n: n in [1..100000] | IsPrime(n) and IsPrime(9*n+4) and IsPrime(81*n+40)] // _Vincenzo Librandi_, Aug 04 2010

%K nonn

%O 1,1

%A _David W. Wilson_