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.

A151800 Least prime > n (version 2 of the "next prime" function).

This page as a plain text file.
%I A151800 #78 Mar 17 2025 14:29:00
%S A151800 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,
%T A151800 29,29,29,29,31,31,37,37,37,37,37,37,41,41,41,41,43,43,47,47,47,47,53,
%U A151800 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,79
%N A151800 Least prime > n (version 2 of the "next prime" function).
%C A151800 Version 1 of the "next prime" function is A007918: smallest prime >= n.
%C A151800 Maple's nextprime() is this version 2; PARI/GP's nextprime() is version 1.
%C A151800 See A007918 for references and further information.
%C A151800 a(n) is the smallest number greater than one that is not divisible by any 1 < k <= n. Consider a multi-round election in which, in each round, voters each cast one vote for one of the remaining candidates. Then, any candidates which receive the fewest votes in that round are eliminated. This repeats until either one candidate remains, who wins the election, or no candidates remain. a(n) is the smallest nontrivial number of voters that can guarantee a winner if the election initially has n > 0 candidates. This is a consequence of the first fact. - _Thomas Anton_, Mar 30 2020
%C A151800 Conjecture: if n > 3, then a(n) < n^(n^(1/n)). - _Thomas Ordowski_, Feb 23 2023
%H A151800 Daniel Forgues, <a href="/A151800/b151800.txt">Table of n, a(n) for n = 0..100000</a>
%F A151800 a(n) = A007918(n+1).
%F A151800 a(n) = 1 + Sum_{k=1..2n} (floor((n!^k)/k!) - floor(((n!^k)-1)/k!)). - _Anthony Browne_, May 11 2016
%F A151800 a(n) = A000040(A036234(n)). - _Ridouane Oudra_, Sep 30 2024
%p A151800 map(nextprime,[$0..100]); # _Robert Israel_, Jul 15 2015
%t A151800 NextPrime[Range[0,80]] (* _Harvey P. Dale_, May 21 2011 *)
%o A151800 (Maxima) makelist(next_prime(n), n, 0, 73); /* _Bruno Berselli_, May 20 2011 */
%o A151800 (Haskell) a151800 = a007918 . (+ 1)  -- _Reinhard Zumkeller_, Jul 26 2012
%o A151800 (PARI) a(n)=nextprime(n+1) \\ _Charles R Greathouse IV_, Apr 28 2015
%o A151800 (Magma) [NextPrime(n): n in [0..80]]; // _Vincenzo Librandi_, Jan 14 2016
%o A151800 (Python)
%o A151800 from sympy import nextprime
%o A151800 def A151800(n):
%o A151800     return nextprime(n) # _Chai Wah Wu_, Feb 28 2018
%Y A151800 Cf. A000040, A007917, A007918, A061558, A066169, A151799, A317357, A036234.
%K A151800 nonn,easy,nice
%O A151800 0,1
%A A151800 _N. J. A. Sloane_, Jun 29 2009