%I #87 Mar 12 2023 17:45:28
%S 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,
%T 29,29,29,29,29,31,31,37,37,37,37,37,37,41,41,41,41,43,43,47,47,47,47,
%U 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
%N Least prime >= n (version 1 of the "next prime" function).
%C Version 2 of the "next prime" function is "smallest prime > n". This produces A151800.
%C Maple uses version 2.
%C 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
%C 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
%C 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
%C Run lengths of successive equal terms are given by A125266. - _Felix Fröhlich_, May 29 2022
%C Conjecture: if n > 1, then a(n) < n^(n^(1/n)). - _Thomas Ordowski_, Feb 23 2023
%H T. D. Noe, <a href="/A007918/b007918.txt">Table of n, a(n) for n = 0..10000</a>
%H Jens Kruse Andersen, <a href="http://primerecords.dk/aprecords.htm">Records for primes in arithmetic progressions</a>
%H K. Atanassov, <a href="http://www.gallup.unm.edu/~smarandache/Atanassov-SomeProblems.pdf">On Some of Smarandache's Problems</a>
%H K. Atanassov, <a href="http://nntdm.net/papers/nntdm-05/NNTDM-05-2-80-82.pdf">On the 37th and 38th Smarandache Problems</a>, Notes on Number Theory and Discrete Mathematics, Sophia, Bulgaria, Vol. 5 (1999), No. 2, 83-85.
%H Henry Bottomley, <a href="http://www.se16.info/js/prime.htm">Prime number calculator</a>
%H J. Castillo, <a href="http://www.gallup.unm.edu/~smarandache/funct2.txt">Other Smarandache Type Functions: Inferior/Superior Smarandache f-part of x</a>, Smarandache Notions Journal, Vol. 10, No. 1-2-3, 1999, 202-204.
%H Andrew Granville, <a href="http://www.dms.umontreal.ca/~andrew/PDF/PrimePattMonthly.pdf">Prime Number Patterns</a>
%H Hans Gunter, <a href="http://primepuzzles.net/puzzles/puzz_145.htm">Puzzle 145. The Inferior Smarandache Prime Part and Superior Smarandache Prime Part functions</a>; Solutions by Jean Marie Charrier, Teresinha DaCosta, Rene Blanch, Richard Kelley and Jim Howell.
%H Jonathan Sondow and Eric Weisstein, <a href="http://mathworld.wolfram.com/BertrandsPostulate.html">Bertrand's Postulate</a>, World of Mathematics.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/NextPrime.html">Next Prime</a>, <a href="http://mathworld.wolfram.com/k-TupleConjecture.html">k-tuple conjecture</a>
%H <a href="/index/Pri#primes_AP">Index entries for sequences related to primes in arithmetic progressions</a>
%F For n > 1: a(n) = A000040(A049084(A007917(n)) + 1 - A010051(n)). - _Reinhard Zumkeller_, Jul 26 2012
%F a(n) = A151800(n-1). - _Seiichi Manyama_, Apr 02 2018
%p A007918 := n-> nextprime(n-1); # _M. F. Hasler_, Apr 09 2008
%t NextPrime[Range[-1, 72]] (* _Jean-François Alcover_, Apr 18 2011 *)
%o (PARI) A007918(n)=nextprime(n) \\ _M. F. Hasler_, Jun 24 2011
%o (PARI) for(x=0,100,print1(nextprime(x)",")) \\ _Cino Hilliard_, Jan 15 2007
%o (Haskell)
%o a007918 n = a007918_list !! n
%o a007918_list = 2 : 2 : 2 : concat (zipWith
%o (\p q -> (replicate (fromInteger(q - p)) q))
%o a000040_list $ tail a000040_list)
%o -- _Reinhard Zumkeller_, Jul 26 2012
%o (Magma) [2] cat [NextPrime(n-1): n in [1..80]]; // _Vincenzo Librandi_, Jan 14 2016
%o (Python)
%o from sympy import nextprime
%o def A007918(n): return nextprime(n-1) # _Chai Wah Wu_, Apr 22 2022
%Y Cf. A000040, A007917, A008407, A020497, A061558, A125266, A151799, A151800, A171400.
%K nonn,easy,nice
%O 0,1
%A R. Muller and Charles T. Le (charlestle(AT)yahoo.com)