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.

A038710 a(n) is the smallest prime > product of the first n primes (A002110(n)).

This page as a plain text file.
%I A038710 #45 Jul 18 2023 06:49:14
%S A038710 2,3,7,31,211,2311,30047,510529,9699713,223092907,6469693291,
%T A038710 200560490131,7420738134871,304250263527281,13082761331670077,
%U A038710 614889782588491517,32589158477190044789,1922760350154212639131,117288381359406970983379,7858321551080267055879179
%N A038710 a(n) is the smallest prime > product of the first n primes (A002110(n)).
%H A038710 Alois P. Heinz, <a href="/A038710/b038710.txt">Table of n, a(n) for n = 0..350</a>
%F A038710 a(n) = A002110(n) + A038711(n). - _Alois P. Heinz_, Mar 16 2020
%e A038710 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.
%p A038710 p:= proc(n) option remember; `if`(n<1, 1, p(n-1)*ithprime(n)) end:
%p A038710 a:= n-> nextprime(p(n)):
%p A038710 seq(a(n), n=0..20);  # _Alois P. Heinz_, Mar 16 2020
%t A038710 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 *)
%t A038710 NextPrime/@FoldList[Times,1,Prime[Range[25]]] (* _Harvey P. Dale_, Dec 17 2010 *)
%o A038710 (PARI) a(n) = nextprime(1+factorback(primes(n))); \\ _Michel Marcus_, Sep 25 2016; Dec 24 2022
%o A038710 (Python)
%o A038710 from sympy import nextprime, primorial
%o A038710 def a(n): return nextprime(primorial(n) if n else 1)
%o A038710 print([a(n) for n in range(20)]) # _Michael S. Branicky_, Dec 24 2022
%Y A038710 Cf. A002110, A005235, A007014, A018239, A035345, A038711.
%K A038710 nonn
%O A038710 0,1
%A A038710 _Labos Elemer_, May 02 2000
%E A038710 Offset corrected, incorrect comment and formula removed, and more terms added by _Jinyuan Wang_, Mar 16 2020