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.

A074365 Smallest prime > the concatenation of the first n natural numbers.

Original entry on oeis.org

2, 13, 127, 1237, 12347, 123457, 1234577, 12345701, 123456791, 12345678923, 1234567891013, 123456789101119, 12345678910111223, 1234567891011121343, 123456789101112131449, 12345678910111213141523, 1234567891011121314151753, 123456789101112131415161869
Offset: 1

Views

Author

Joseph L. Pe, Sep 26 2002

Keywords

Examples

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

Crossrefs

Cf. A007908.

Programs

  • 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 *)
  • 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

Formula

a(n) = nextprime(A007908(n)). - Sean A. Irvine, Jan 20 2025

Extensions

More terms from Lior Manor, Oct 08 2002
a(18) and beyond from Michael S. Branicky, Feb 13 2021