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.

A107108 Shorthand of n-th smallest n-digit prime, see comments.

Original entry on oeis.org

2, 3, 7, 21, 61, 69, 117, 189, 193, 181, 259, 193, 303, 411, 487, 513, 931, 591, 861, 667, 801, 1081, 711, 1027, 1321, 1753, 1581, 2109, 1527, 1951, 2613, 2053, 2533, 3171, 2653, 3073, 2769, 2899, 3201, 3133, 4089, 2859, 4447, 5367, 3819, 4923, 5251, 5109, 5127, 6721
Offset: 1

Views

Author

Zak Seidov, May 12 2005

Keywords

Comments

To shorthand the n-th - smallest n-digit prime it is convenient to subtract 10^(n-1) (n>1). Compare a(n) with A069100(n).

Crossrefs

Cf. A069100.

Programs

  • PARI
    a(n)=prime(primepi(10^(n-1))+n)-if(n==1,0,10^(n-1)) \\ Franklin T. Adams-Watters, Mar 07 2014
    
  • PARI
    a(n) = {if(n == 1, return(2)); my(t = 0); forprime(p = 10^(n-1), 10^n, t++; if(t==n, return(p - 10^(n-1))))} \\ David A. Corneth, Jun 16 2021
    
  • Python
    from sympy import nextprime
    def a(n):  return nextprime(10**(n-1), ith=n) - 10**(n-1) * (n > 1)
    print([a(n) for n in range(1, 51)]) # Michael S. Branicky, Jun 16 2021

Formula

a(1)=2; at n>1 a(n)=prime(pi[10^(n-1)]+n)-10^(n-1)=A069100(n)-10^(n-1).

Extensions

a(3) corrected by Franklin T. Adams-Watters, Mar 07 2014
More terms from David A. Corneth, Jun 16 2021