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
KEYWORD
nonn,base
AUTHOR
Eric Angelini and M. F. Hasler, Nov 05 2013
STATUS
approved