login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A038710 a(n) is the smallest prime > product of the first n primes (A002110(n)). 9
2, 3, 7, 31, 211, 2311, 30047, 510529, 9699713, 223092907, 6469693291, 200560490131, 7420738134871, 304250263527281, 13082761331670077, 614889782588491517, 32589158477190044789, 1922760350154212639131, 117288381359406970983379, 7858321551080267055879179 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
LINKS
FORMULA
a(n) = A002110(n) + A038711(n). - Alois P. Heinz, Mar 16 2020
EXAMPLE
for n=1,2,3,4,5,11,75, A002110(n)+1 gives smaller primes than A002110(n)+p, where p is a fortunate number (prime). At n=5, both 2311 and 2333 are primes but the first is smaller.
MAPLE
p:= proc(n) option remember; `if`(n<1, 1, p(n-1)*ithprime(n)) end:
a:= n-> nextprime(p(n)):
seq(a(n), n=0..20); # Alois P. Heinz, Mar 16 2020
MATHEMATICA
nmax = 2^16384; npd = 1; n = 1; npd = npd*Prime[n]; While[npd < nmax, cp = npd + 1; While[ ! (PrimeQ[cp]), cp = cp + 2]; Print[cp]; n = n + 1; npd = npd*Prime[n]] (* Lei Zhou, Feb 15 2005 *)
NextPrime/@FoldList[Times, 1, Prime[Range[25]]] (* Harvey P. Dale, Dec 17 2010 *)
PROG
(PARI) a(n) = nextprime(1+factorback(primes(n))); \\ Michel Marcus, Sep 25 2016; Dec 24 2022
(Python)
from sympy import nextprime, primorial
def a(n): return nextprime(primorial(n) if n else 1)
print([a(n) for n in range(20)]) # Michael S. Branicky, Dec 24 2022
CROSSREFS
Sequence in context: A081947 A046972 A006862 * A241196 A073918 A018239
KEYWORD
nonn
AUTHOR
Labos Elemer, May 02 2000
EXTENSIONS
Offset corrected, incorrect comment and formula removed, and more terms added by Jinyuan Wang, Mar 16 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 26 01:38 EDT 2024. Contains 371989 sequences. (Running on oeis4.)