A007918 Least prime >= n (version 1 of the "next prime" function).
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
Links
- T. D. Noe, Table of n, a(n) for n = 0..10000
- Jens Kruse Andersen, Records for primes in arithmetic progressions
- K. Atanassov, On Some of Smarandache's Problems
- K. Atanassov, On the 37th and 38th Smarandache Problems, Notes on Number Theory and Discrete Mathematics, Sophia, Bulgaria, Vol. 5 (1999), No. 2, 83-85.
- Henry Bottomley, Prime number calculator
- J. Castillo, Other Smarandache Type Functions: Inferior/Superior Smarandache f-part of x, Smarandache Notions Journal, Vol. 10, No. 1-2-3, 1999, 202-204.
- Andrew Granville, Prime Number Patterns
- Hans Gunter, Puzzle 145. The Inferior Smarandache Prime Part and Superior Smarandache Prime Part functions; Solutions by Jean Marie Charrier, Teresinha DaCosta, Rene Blanch, Richard Kelley and Jim Howell.
- Jonathan Sondow and Eric Weisstein, Bertrand's Postulate, World of Mathematics.
- Eric Weisstein's World of Mathematics, Next Prime, k-tuple conjecture
- Index entries for sequences related to primes in arithmetic progressions
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
a(n) = A151800(n-1). - Seiichi Manyama, Apr 02 2018
Comments