OFFSET
1,1
COMMENTS
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
LINKS
John Cerkan, Table of n, a(n) for n = 1..10000
FORMULA
a(n) == 13 (mod 14). - John Cerkan, Aug 26 2016
EXAMPLE
13 * 10 + 9 = 139, which is prime.
139 * 10 + 9 = 1399, which is also prime.
1399 * 10 + 9 = 13999, which is also prime.
13999 * 10 + 9 = 139999, which is also prime.
139999 * 10 + 9 = 1399999, which is also prime.
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.
17 * 10 + 9 = 179, which is prime.
179 * 10 + 9 = 1799 = 7 * 257. As this falls short of the five iterations needed, 17 is not in the sequence.
MATHEMATICA
Select[Prime@ Range[10^6], Times @@ Boole@ PrimeQ@ NestList[10 # + 9 &, #, 5] > 0 &] (* Michael De Vlieger, Aug 26 2016 *)
(* 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 *)
PROG
(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
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved