cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A140793 Smallest prime which is the concatenation of 2 or more consecutive numbers starting with n, or -1 if no such prime exists.

Original entry on oeis.org

23, 345678910111213141516171819, 4567, 567891011121314151617, 67, 78910111213, 89
Offset: 2

Views

Author

Lekraj Beedassy, Jul 15 2008

Keywords

Comments

Comment from Ray G. Opao, Sep 30 2008: a(9) is the following number:
91011121314151617181920212223242526272829303132333435363738394041424
34445464748495051525354555657585960616263646566676869707172737475767
77879808182838485868788899091929394959697989910010110210310410510610
71081091101111121131141151161171181191201211221231241251261271281291
30131132133134135136137138139140141142143144145146147148149150151152
15315415515615715815916016116216316416516616716816917017117217317417
5176177178179180181182183184185186187.

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{c = n, k = n + 1}, While[c = 10^IntegerLength[k] c + k; p = c; !PrimeQ[c], k++]; c]; Table[f[n], {n, 2, 8}] (* Robert G. Wilson v, Jun 24 2012 *)
    pr[n_]:=Module[{k=1},While[!PrimeQ[FromDigits[Flatten[IntegerDigits/@Range[n,n+k]]]],k++];FromDigits[Flatten[IntegerDigits/@Range[n,n+k]]]]; Array[pr,8,2] (* Harvey P. Dale, Mar 14 2014 *)
  • PARI
    A140793(n,N=n,T=10^logint(n,10))=while(T*=10,for(m=n+1,n=T-1,ispseudoprime(N=N*T+m)&&return(N))) \\ M. F. Hasler, Feb 22 2021

Formula

a(n) = concatenate( n, ..., A084559(n)). - M. F. Hasler, Feb 22 2021

Extensions

Added escape clause to definition. - N. J. A. Sloane, Feb 22 2021