A074721 Concatenate the primes as 2357111317192329313..., then insert commas from left to right so that between each pair of successive commas is a prime, always making the new prime as small as possible.
2, 3, 5, 7, 11, 13, 17, 19, 2, 3, 2, 93137414347535961677173798389971011031071091131, 2, 7, 13, 11, 3, 7, 13, 91491511, 5, 7, 163, 167, 17, 3, 17, 9181, 19, 11, 9319, 7, 19, 9211223227229233239241251257, 2, 6326927, 127, 7, 2, 81283, 2, 93307, 3, 11, 3, 13, 3, 17, 3, 3, 13, 3, 7, 3, 47, 3, 493533593673733
Offset: 1
Links
- Robert G. Wilson v, Table of n, a(n) for n = 1..329 [a(330) is too large to be included in a b-file: see the a-file]
- Hans Havermann, Two-color listing of 5359 terms
- Robert G. Wilson v, Table of n, a(n) for n = 1..1289
Programs
-
Haskell
a074721 n = a074721_list !! (n-1) a074721_list = f 0 $ map toInteger a033308_list where f c ds'@(d:ds) | a010051'' c == 1 = c : f 0 ds' | otherwise = f (10 * c + d) ds -- Reinhard Zumkeller, Mar 11 2014
-
Mathematica
id = IntegerDigits@ Array[ Prime, 3000] // Flatten; lst = {}; Do[ k = 1; While[ p = FromDigits@ Take[ id, k]; !PrimeQ@p || p == 1, k++ ]; AppendTo[lst, p]; id = Drop[id, k], {n, 1289}]
-
PARI
a=0; tryd(d) = { a=a*10+d; if(isprime(a),print(a);a=0); } try(p) = { if(p>=10,try(p\10)); tryd(p%10); } forprime(p=2,1000,try(p)); \\ Jack Brennen, Jun 25 2009
Extensions
Edited by Robert G. Wilson v, Jun 26 2009
Further edited by N. J. A. Sloane, Jun 27 2009, incorporating comments from Leroy Quet, Hans Havermann, Jack Brennen and Franklin T. Adams-Watters
Comments