login
Primes that remain prime through 5 iterations of the function f(x) = 10x + 9.
1

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

%S 13,293,6089,12823,37967,40949,121687,192037,243487,379679,409499,

%T 471841,1006193,1217131,1397311,1438793,1503613,1541063,1754591,

%U 2058629,2088421,2346791,2360357,2428243,2458609,2621527,2646167,2721053,3223247,3280003

%N Primes that remain prime through 5 iterations of the function f(x) = 10x + 9.

%C p, 10*p + 9, 100*p + 99, 1000*p + 999, 10000*p + 9999 and 100000*p + 99999 are prime for each term p. - _Vincenzo Librandi_, Aug 05 2010

%H John Cerkan, <a href="/A023357/b023357.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) == 13 (mod 14). - _John Cerkan_, Aug 26 2016

%e 13 * 10 + 9 = 139, which is prime.

%e 139 * 10 + 9 = 1399, which is also prime.

%e 1399 * 10 + 9 = 13999, which is also prime.

%e 13999 * 10 + 9 = 139999, which is also prime.

%e 139999 * 10 + 9 = 1399999, which is also prime.

%e 1399999 * 10 + 9 = 13999999 = 13 * 503 * 2141. This is the sixth iteration, but only five iterations are needed for 13 to be in the sequence.

%e 17 * 10 + 9 = 179, which is prime.

%e 179 * 10 + 9 = 1799 = 7 * 257. As this falls short of the five iterations needed, 17 is not in the sequence.

%t Select[Prime@ Range[10^6], Times @@ Boole@ PrimeQ@ NestList[10 # + 9 &, #, 5] > 0 &] (* _Michael De Vlieger_, Aug 26 2016 *)

%t (* The following program uses the AllTrue function from Mathematica version 10 *) Select[Prime[Range[250000]], AllTrue[Rest[NestList[10# + 9 &, #, 5]], PrimeQ]&] (* _Harvey P. Dale_, Jul 31 2018 *)

%o (Magma) [n: n in [1..19000000] | IsPrime(n) and IsPrime(10*n+9) and IsPrime(100*n+99) and IsPrime(1000*n+999) and IsPrime(10000*n+9999) and IsPrime(100000*n+99999)] // _Vincenzo Librandi_, Aug 05 2010

%o (PARI) is(n)=isprime(n) && isprime(10*n+9) && isprime(100*n+99) && isprime(1000*n+999) && isprime(10000*n+9999) && isprime(100000*n+99999) \\ _Charles R Greathouse IV_, Jul 28 2016

%K nonn

%O 1,1

%A _David W. Wilson_