A069837 Smallest prime which is a concatenation of n primes.
2, 23, 223, 2237, 22273, 222323, 2222273, 22222223, 222222227, 2222222377, 22222222223, 222222223273, 2222222222273, 22222222222327, 222222222222227, 2222222222222533, 22222222222223557, 222222222222222577, 2222222222222222327, 22222222222222222253, 222222222222222222277, 2222222222222222222273, 22222222222222222222327
Offset: 1
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..400
- C. Caldwell, Prime Curios!: a(101).
Programs
-
Mathematica
f[n_] := Block[{p = 2(10^n - 1)/9}, While[ !PrimeQ[p] || Union[ PrimeQ[ IntegerDigits[p]]] != {True}, p++ ]; p]; Table[ f[n], {n, 1, 20}]
-
PARI
A069837(n)={ local( p=(10^n-1)\9*2-1 ); n=Vec("2357"); until( !setminus( Set(Vec(Str(p))), n), p=nextprime(p+1)); p } /* a more efficient version should check digits one by one and skip to the next possible candidate (i.e., add 12...23 - p%10^d) when a nonprime digit is found */ \\ M. F. Hasler, Apr 25 2008
Extensions
Edited, corrected and extended by Robert G. Wilson v, Apr 22 2002
Comments