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).

This page as a plain text file.
%I A007918 #88 Feb 16 2025 08:32:31
%S A007918 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 A007918 29,29,29,29,29,31,31,37,37,37,37,37,37,41,41,41,41,43,43,47,47,47,47,
%U A007918 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 A007918 Least prime >= n (version 1 of the "next prime" function).
%C A007918 Version 2 of the "next prime" function is "smallest prime > n". This produces A151800.
%C A007918 Maple uses version 2.
%C A007918 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 A007918 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 A007918 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 A007918 Run lengths of successive equal terms are given by A125266. - _Felix Fröhlich_, May 29 2022
%C A007918 Conjecture: if n > 1, then a(n) < n^(n^(1/n)). - _Thomas Ordowski_, Feb 23 2023
%H A007918 T. D. Noe, <a href="/A007918/b007918.txt">Table of n, a(n) for n = 0..10000</a>
%H A007918 Jens Kruse Andersen, <a href="http://primerecords.dk/aprecords.htm">Records for primes in arithmetic progressions</a>
%H A007918 K. Atanassov, <a href="http://www.gallup.unm.edu/~smarandache/Atanassov-SomeProblems.pdf">On Some of Smarandache's Problems</a>
%H A007918 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 A007918 Henry Bottomley, <a href="http://www.se16.info/js/prime.htm">Prime number calculator</a>
%H A007918 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 A007918 Andrew Granville, <a href="http://www.dms.umontreal.ca/~andrew/PDF/PrimePattMonthly.pdf">Prime Number Patterns</a>
%H A007918 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 A007918 Jonathan Sondow and Eric Weisstein, <a href="https://mathworld.wolfram.com/BertrandsPostulate.html">Bertrand's Postulate</a>, World of Mathematics.
%H A007918 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/NextPrime.html">Next Prime</a>, <a href="https://mathworld.wolfram.com/k-TupleConjecture.html">k-tuple conjecture</a>
%H A007918 <a href="/index/Pri#primes_AP">Index entries for sequences related to primes in arithmetic progressions</a>
%F A007918 For n > 1: a(n) = A000040(A049084(A007917(n)) + 1 - A010051(n)). - _Reinhard Zumkeller_, Jul 26 2012
%F A007918 a(n) = A151800(n-1). - _Seiichi Manyama_, Apr 02 2018
%p A007918 A007918 := n-> nextprime(n-1); # _M. F. Hasler_, Apr 09 2008
%t A007918 NextPrime[Range[-1, 72]] (* _Jean-François Alcover_, Apr 18 2011 *)
%o A007918 (PARI) A007918(n)=nextprime(n)  \\ _M. F. Hasler_, Jun 24 2011
%o A007918 (PARI) for(x=0,100,print1(nextprime(x)",")) \\ _Cino Hilliard_, Jan 15 2007
%o A007918 (Haskell)
%o A007918 a007918 n = a007918_list !! n
%o A007918 a007918_list = 2 : 2 : 2 : concat (zipWith
%o A007918               (\p q -> (replicate (fromInteger(q - p)) q))
%o A007918                                    a000040_list $ tail a000040_list)
%o A007918 -- _Reinhard Zumkeller_, Jul 26 2012
%o A007918 (Magma) [2] cat [NextPrime(n-1): n in [1..80]]; // _Vincenzo Librandi_, Jan 14 2016
%o A007918 (Python)
%o A007918 from sympy import nextprime
%o A007918 def A007918(n): return nextprime(n-1) # _Chai Wah Wu_, Apr 22 2022
%Y A007918 Cf. A000040, A007917, A008407, A020497, A061558, A125266, A151799, A151800, A171400.
%K A007918 nonn,easy,nice
%O A007918 0,1
%A A007918 R. Muller and Charles T. Le (charlestle(AT)yahoo.com)