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.

A007918 Least prime >= n (version 1 of the "next prime" function).

Original entry on oeis.org

2, 2, 2, 3, 5, 5, 7, 7, 11, 11, 11, 11, 13, 13, 17, 17, 17, 17, 19, 19, 23, 23, 23, 23, 29, 29, 29, 29, 29, 29, 31, 31, 37, 37, 37, 37, 37, 37, 41, 41, 41, 41, 43, 43, 47, 47, 47, 47, 53, 53, 53, 53, 53, 53, 59, 59, 59, 59, 59, 59, 61, 61, 67, 67, 67, 67, 67, 67, 71, 71, 71, 71, 73, 73
Offset: 0

Views

Author

R. Muller and Charles T. Le (charlestle(AT)yahoo.com)

Keywords

Comments

Version 2 of the "next prime" function is "smallest prime > n". This produces A151800.
Maple uses version 2.
According to the "k-tuple" conjecture, a(n) is the initial term of the lexicographically earliest increasing arithmetic progression of n primes; the corresponding common differences are given by A061558. - David W. Wilson, Sep 22 2007
It is easy to show that the initial term of an increasing arithmetic progression of n primes cannot be smaller than a(n). - N. J. A. Sloane, Oct 18 2007
Also, smallest prime bounded by n and 2n inclusively (in accordance with Bertrand's theorem). Smallest prime >n is a(n+1) and is equivalent to smallest prime between n and 2n exclusively. - Lekraj Beedassy, Jan 01 2007
Run lengths of successive equal terms are given by A125266. - Felix Fröhlich, May 29 2022
Conjecture: if n > 1, then a(n) < n^(n^(1/n)). - Thomas Ordowski, Feb 23 2023

Crossrefs

Programs

  • Haskell
    a007918 n = a007918_list !! n
    a007918_list = 2 : 2 : 2 : concat (zipWith
                  (\p q -> (replicate (fromInteger(q - p)) q))
                                       a000040_list $ tail a000040_list)
    -- Reinhard Zumkeller, Jul 26 2012
    
  • Magma
    [2] cat [NextPrime(n-1): n in [1..80]]; // Vincenzo Librandi, Jan 14 2016
    
  • Maple
    A007918 := n-> nextprime(n-1); # M. F. Hasler, Apr 09 2008
  • Mathematica
    NextPrime[Range[-1, 72]] (* Jean-François Alcover, Apr 18 2011 *)
  • PARI
    A007918(n)=nextprime(n)  \\ M. F. Hasler, Jun 24 2011
    
  • PARI
    for(x=0,100,print1(nextprime(x)",")) \\ Cino Hilliard, Jan 15 2007
    
  • Python
    from sympy import nextprime
    def A007918(n): return nextprime(n-1) # Chai Wah Wu, Apr 22 2022

Formula

For n > 1: a(n) = A000040(A049084(A007917(n)) + 1 - A010051(n)). - Reinhard Zumkeller, Jul 26 2012
a(n) = A151800(n-1). - Seiichi Manyama, Apr 02 2018