login
A231206
List the minimum run lengths of terms whose concatenation yields a prime; always use the smallest (positive) number not occurring earlier.
2
2, 3, 1, 4, 9, 5, 6, 7, 8, 19, 10, 11, 12, 13, 14, 15, 16, 17, 139, 18, 20, 21, 22, 59, 23, 24, 25, 26, 27, 63, 28, 29, 30, 31, 32, 33, 71, 34, 35, 36, 37, 38, 39, 40, 57, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 58, 60, 109, 61, 62, 64, 65, 66, 67, 68, 69, 70, 189, 72, 73
OFFSET
1,1
COMMENTS
The primes (23, 149, 5, 67819, 1011121314151617139, 1820212259, 232425262763, 28293031323371, ...) are listed in A231207.
LINKS
Eric Angelini, Prime runs.
Eric Angelini, Prime Runs [Cached copy, with permission]
EXAMPLE
The first a(1) = 2 terms yield the prime 23. The next a(2) = 3 terms yield the prime 149, etc.: We see that the terms satisfy the requirement of yielding primes by concatenating the first a(1) terms, then the next a(2) terms, then the next a(3) terms of the sequence, etc. But what about minimality?
The first term can't be 1 since that would mean that taking one single term, i.e., that 1, one would get a prime.
But a(1) = 2 is possible without contradiction, as we can see, so that is the least possible choice and therefore by definition the first term a(1).
Now we can't choose 1 for a(2), which would not yield a prime (as concatenation of the first a(1) = 2 terms a(1) and a(2), which would then be 21 = 3*7). The number 2 also isn't possible for a(2), since already used for a(1). However, a(2) = 3 is possible. Then a(3) = 1 and a(4) = 4 (the least numbers not yet used) don't lead to contradictions, although we must keep in mind that choosing a(3) = 1 means that the next term after a(5) must be a prime on its own. Since concatenation of the a(2) = 3 terms a(3..5) must be prime, the next term a(5) cannot be 5, 6, 7 or 8, but a(5) = 9 is possible. And so on.
PROG
(PARI) {verbose=1; a=[prefix=2]; remain=pointer=1; used=c=0; for(n=1, 499, used+=1<<a[n]; verbose>1 && print1(a[n]", "); if( !remain, remain=a[pointer++]; verbose && print1(" /* "c++, "th prime (ending in a("n")) = ", prefix, " */"); prefix="" )/*end if*/; for(i=1, 1e9, bittest(used, i) && next; remain >1 || ispseudoprime( eval( Str( prefix, i ))) || next; prefix=Str(prefix, i); a=concat(a, i); remain--; break )/*end for i*/); a}
CROSSREFS
Sequence in context: A121340 A332635 A358664 * A165241 A119865 A177896
KEYWORD
nonn,base
AUTHOR
Eric Angelini and M. F. Hasler, Nov 05 2013
STATUS
approved