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!)
A074365 Smallest prime > the concatenation of the first n natural numbers. 2
2, 13, 127, 1237, 12347, 123457, 1234577, 12345701, 123456791, 12345678923, 1234567891013, 123456789101119, 12345678910111223, 1234567891011121343, 123456789101112131449, 12345678910111213141523, 1234567891011121314151753, 123456789101112131415161869 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Michael S. Branicky, Table of n, a(n) for n = 1..369 (all terms with <= 1000 digits).

EXAMPLE

The first prime > 123, the concatenation of the first three natural numbers, is 127. Hence a(3) = 127.

MAPLE

a:= n-> nextprime(parse(cat($1..n))):

seq(a(n), n=1..19);  # Alois P. Heinz, Feb 13 2021

MATHEMATICA

p[n_] := Module[{r, i}, r = 2; i = 1; While[r <= n, i = i + 1; r = Prime[i]]; r]; s = ""; a = {}; Do[s = s <> ToString[Prime[i]]; a = Append[a, p[ToExpression[s]]], {i, 1, 8}]; a

Table[NextPrime[FromDigits[Flatten[IntegerDigits/@Range[n]]]], {n, 20}] (* Harvey P. Dale, Jan 16 2018 *)

PROG

(Python)

from sympy import nextprime

def a(n):

  return nextprime(int("".join(map(str, (i for i in range(1, n+1)))))-1)

print([a(n) for n in range(1, 19)]) # Michael S. Branicky, Feb 13 2021

CROSSREFS

Sequence in context: A151361 A328008 A073559 * A071362 A108471 A036078

Adjacent sequences:  A074362 A074363 A074364 * A074366 A074367 A074368

KEYWORD

base,nonn

AUTHOR

Joseph L. Pe, Sep 26 2002

EXTENSIONS

More terms from Lior Manor Oct 08 2002

a(18) and beyond from Michael S. Branicky, Feb 13 2021

STATUS

approved

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 July 1 09:41 EDT 2022. Contains 354958 sequences. (Running on oeis4.)