

A231206


List the number of subsequent terms whose concatenation yields a prime; always use the smallest possible 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
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

The primes (23, 149, 5, 67819, 1011121314151617139, 1820212259, 232425262763, 28293031323371, ...) are listed in A231207.


LINKS

E. 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.
The sequence cannot start with 1, but a(1)=2 is possible; a(2)=1 would not yield a prime (as concatenation of the a(1)=2 terms a(1) and a(2)) and '2' is used earlier, but a(2)=3 is possible. Then a(3)=1 and a(4)=4 (the least number not yet used) don't lead to contradictions. Since concatenation of the a(2)=3 terms a(3..5) must be prime, the next term cannot be 5, 6, 7 or 8, but a(5)=9 is possible.


PROG

(PARI) {vebosity=1; a=[prefix=2]; remain=pointer=1; used=c=0; for(n=1, 499, used+=1<<a[n]; vebosity>1 && print1(a[n]", "); if( !remain, remain=a[pointer++]; vebosity && 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



STATUS

approved



