A110053 Numbers n such that the string 111n is the decimal expansion of a prime number.
7, 13, 17, 19, 31, 49, 59, 61, 71, 73, 77, 97, 103, 109, 119, 121, 127, 143, 149, 187, 191, 211, 217, 227, 229, 253, 263, 269, 271, 301, 317, 323, 337, 341, 347, 373, 409, 427, 431, 439, 443, 467, 487, 491, 493, 497, 509, 521, 533, 539, 577, 581, 593, 599
Offset: 1
Examples
7 is in the sequence because 1117 is prime. 73 is in the sequence because 11173 is prime. 103 is in the sequence because 111103 is prime.
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..2500
Programs
-
Magma
[ n: n in [1..600] | IsPrime(Seqint(Intseq(n) cat [1, 1, 1])) ];
-
Maple
a:= proc(n) local k; for k from 1 +`if`(n=1, 0, a(n-1)) while not isprime(parse(""||111||k)) do od; a(n):=k end: seq(a(n), n=1..100); # Alois P. Heinz, Jul 30 2014
-
Mathematica
Select[Range[1000], PrimeQ[FromDigits[Join[{1, 1, 1}, IntegerDigits[ # ]]]] &] (* Alonso Delarte, Sep 06 2005 *) Select[Range[600], PrimeQ[111 10^IntegerLength[#] + #] &] (* Vincenzo Librandi, Jul 30 2014 *)
Extensions
More terms from Alonso del Arte, Sep 06 2005