login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A231206 List the number of subsequent terms whose concatenation yields a prime; always use the smallest possible number not occurring earlier. 2

%I #18 Jun 10 2016 00:21:00

%S 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,

%T 24,25,26,27,63,28,29,30,31,32,33,71,34,35,36,37,38,39,40,57,41,42,43,

%U 44,45,46,47,48,49,50

%N List the number of subsequent terms whose concatenation yields a prime; always use the smallest possible number not occurring earlier.

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

%H E. Angelini, <a href="http://www.cetteadressecomportecinquantesignes.com/PrimeRuns.htm">Prime runs</a>

%H E. Angelini, <a href="/A231206/a231206.pdf">Prime Runs</a> [Cached copy, with permission]

%e The first a(1)=2 terms yield the prime 23. The next a(2)=3 terms yield the prime 149, etc.

%e 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.

%o (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}

%K nonn,base

%O 1,1

%A _Eric Angelini_ and _M. F. Hasler_, Nov 05 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 20:33 EDT 2024. Contains 371916 sequences. (Running on oeis4.)