[go: up one dir, main page]

login
Search: a002386 -id:a002386
     Sort: relevance | references | number | modified | created      Format: long | short | data
Record gaps between primes (upper end) (compare A002386, which gives lower ends of these gaps).
(Formerly M2485 N0984)
+20
78
3, 5, 11, 29, 97, 127, 541, 907, 1151, 1361, 9587, 15727, 19661, 31469, 156007, 360749, 370373, 492227, 1349651, 1357333, 2010881, 4652507, 17051887, 20831533, 47326913, 122164969, 189695893, 191913031, 387096383, 436273291, 1294268779
OFFSET
1,1
COMMENTS
See A002386 for complete list of known terms and further references.
Except for a(1)=3 and a(2)=5, a(n) = A168421(k). Primes 3 and 5 are special in that they are the only primes which do not have a Ramanujan prime between them and their double, <= 6 and 10 respectively. Because of the large size of a gap, there are many repeats of the prime number in A168421. - John W. Nicholson, Dec 10 2013
REFERENCES
B. C. Berndt, Ramanujan's Notebooks Part IV, Springer-Verlag, see p. 133.
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Brian Kehrig, Table of n, a(n) for n = 1..83 (first 75 terms from Alex Beveridge and M. F. Hasler, terms n=76..80 added by John W. Nicholson)
Jens Kruse Andersen and Norman Luhn, Record Prime Gaps
Andrew Booker, The Nth Prime Page
Kevin Ford, Ben Green, Sergei Konyagin, James Maynard, and Terence Tao, Long gaps between primes, arXiv:1412.5029 [math.NT], 2014-2016.
Alexei Kourbatov, Tables of record gaps between prime constellations, arXiv preprint arXiv:1309.4053 [math.NT], 2013.
Alexei Kourbatov and Marek Wolf, Predicting maximal gaps in sets of primes, arXiv preprint arXiv:1901.03785 [math.NT], 2019.
Thomas R. Nicely, First occurrence prime gaps [Local copy, pdf only]
Tomás Oliveira e Silva, Computational projects
Tomás Oliveira e Silva, Siegfried Herzog and Silvio Pardi, Empirical verification of the even Goldbach conjecture and computation of prime gaps up to 4.10^18, Math. Comp., 83 (2014), 2033-2060.
Daniel Shanks, On maximal gaps between successive primes, Math. Comp., 18 (1964), 646-651.
Eric Weisstein's World of Mathematics, Prime Gaps
Wikipedia, Prime gap
Robert G. Wilson v, Notes (no date)
Marek Wolf, A Note on the Andrica Conjecture, arXiv:1010.3945 [math.NT], 2010.
J. Young and A. Potler, First occurrence prime gaps, Math. Comp., 52 (1989), 221-224.
FORMULA
a(n) = A002386(n) + A005250(n) = A008995(n-1) + 1. - M. F. Hasler, Dec 13 2007
MATHEMATICA
s = {3}; gm = 1; Do[p = Prime[n + 1]; g = p - Prime[n]; If[g > gm, Print[p]; AppendTo[s, p]; gm = g], {n, 2, 1000000}]; s (* Jean-François Alcover, Mar 31 2011 *)
PROG
(PARI) p=q=2; g=0; until( g<(q=nextprime(1+p=q))-p & print1(p+g=q-p, ", "), ) \\ M. F. Hasler, Dec 13 2007
CROSSREFS
Cf. A000040, A001223 (differences between primes), A002386 (lower ends), A005250 (record gaps), A107578.
Cf. also A005669, A111943.
KEYWORD
nonn,nice
STATUS
approved
a(n) = A246776(A005669(n)): using the indices of maximal primes in A002386 in order to verify the Firoozbakht conjecture for 0 <= floor(prime(n)^(1+1/n)) - prime(n+1).
+20
6
1, 0, 0, 3, 10, 5, 16, 19, 20, 10, 38, 38, 35, 24, 43, 53, 38, 43, 66, 52, 46, 65, 79, 55, 73, 104, 109, 95, 120, 92, 130, 130, 121, 127, 114, 127, 155, 148, 92, 109, 159, 171, 173, 180, 171, 157, 171, 161, 174, 178, 168, 165, 169, 135, 171, 168, 138, 174, 195, 234, 149, 253, 269, 61, 244, 248, 255, 323, 304, 307, 262, 245, 234, 215, 228
OFFSET
1,4
COMMENTS
a(1) > 0 and a(n) >= 0 for n < 76; this implies "if p=p(k) is in the sequence A002386 and p <= 1425172824437699411 then p(k+1)^(1/(k+1)) < p(k)^(1/k)."
FORMULA
a(n) = A246776(A005669(n)).
MATHEMATICA
f[n_] := Block[{d, i, j, m = 0}, Reap@ For[i = 1, i <= n, i++, d = Prime[i + 1] - Prime@ i; If[d > m, m = d; Sow@ i, False]] // Flatten // Rest] (* A005669 *); g[n_] := Floor[Prime[n]^(1 + 1/n)] - Prime[n + 1] (* A246776 *); g@ f@ 100000; (* Michael De Vlieger, Mar 24 2015, with code from A246776 by Farideh Firoozbakht *)
KEYWORD
nonn
AUTHOR
Farideh Firoozbakht, Sep 30 2014
STATUS
approved
a(n) = largest Ramanujan prime R_k in A104272 that is <= A002386(n).
+20
5
2, 2, 2, 17, 71, 107, 503, 881, 1103, 1301, 9521, 15671, 19543, 31387, 155849, 360289, 370061, 492067, 1349147, 1356869, 2010553, 4652239, 17051297, 20831119, 47326519, 122164649, 189695483, 191912659
OFFSET
1,1
COMMENTS
While many values in A214757(n) are equal to A000101(n), here it seems the only value such that A002386(n) is equal to a(n) is a(1) = R_k = A002386(1) = 2.
See "Let rho(m) = A179196(m)" comment at A001223.
LINKS
EXAMPLE
A104272(94) = 1301 < 1327 = A002386(10), so a(10) = 1301.
PROG
(Perl) use ntheory ":all"; sub a_from_2386 { my $n = shift; $n = prev_prime($n) while !is_ramanujan_prime($n); $n } # Dana Jacobsen, Jul 13 2016
(Perl) perl -Mntheory=:all -nE 'my $n=$1 if /(\d+)$/; $r=ramanujan_primes($n>1e6 ? $n-1e6 : 2, $n); say ++$x, " ", $r->[-1]; ' b002386.txt # Dana Jacobsen, Jul 13 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
John W. Nicholson, Jul 27 2012
EXTENSIONS
Edited by N. J. A. Sloane, Aug 06 2012
a(16)-a(28) from Donovan Johnson, Nov 04 2012
STATUS
approved
a(n) = ceiling(A002386(n+1)/A002386(n)).
+20
0
2, 3, 4, 4, 2, 5, 2, 2, 2, 8, 2, 2, 2, 5, 3, 2, 2, 3, 2, 2, 3, 4, 2, 3, 3, 2, 2, 3, 2, 3, 2, 2, 2, 2, 3, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 3, 3, 2, 2, 6, 2, 2, 26, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 5, 2, 3, 2, 2
OFFSET
1,1
COMMENTS
Obviously, for all n, a(n) is greater than one. According to the definition of a(n) for all n, A002386(n+1) < a(n)*A002386(n). So if n is less than 79 and not equal to 64, then A002386(n+1) < 8*A002386(n). [Updated John W. Nicholson, Nov 28 2019]
Also for all n < 79, A002386(n+1) < 26*A002386(n). [Updated John W. Nicholson, Nov 28 2019]
The strictly increasing terms of the sequence: 2, 3, 4, 5, 8, 26, ?, ... .
Record values are {2, 3, 4, 5, 8, 26} = {a(1), a(2), a(3), a(6), a(10), a(64)}.
A very difficult question: "What is the next term of the above sequence?" namely "What is the next term of the sequence which is greater than a(64) = 26 ?". I don't think that in this century anyone can find the answer.
FORMULA
a(n) = ceiling(A002386(n+1)/A002386(n)) = floor(A002386(n+1)/A002386(n))+1.
EXAMPLE
a(10) = ceiling(A002386(11)/A002386(10)) = ceiling(9551/1327) = 8.
CROSSREFS
KEYWORD
nonn,more,hard
AUTHOR
Farideh Firoozbakht, Oct 08 2014
STATUS
approved
Number of terms of A002386 (primes preceding record prime gaps) in the interval (2^n, 2^(n+1)].
+20
0
1, 1, 1, 0, 1, 0, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 1, 3, 0, 3, 0, 1, 0, 2, 1, 1, 2, 2, 0, 2, 2, 1, 1, 3, 1, 1, 2, 5, 2, 3, 1, 1, 1, 1, 1, 1, 2, 0, 0, 3, 0, 0, 0, 0, 2, 1, 2, 4, 1, 1, 0, 2, 3
OFFSET
0,7
COMMENTS
The record prime gaps are in A005250; the corresponding primes are in A002386.
EXAMPLE
For n=3, there are no primes p_m in A002386 in the range 2^3 = 8 < p_m <= 16 = 2^4, so a(3)=0.
For n=6, there are 2 primes p_m in A002386 in the range 2^6 = 64 < p_m <= 128 = 2^7, namely p_m = 89, 113, so a(6)=2.
CROSSREFS
Cf. A000101 (upper ends), A005250 (record gaps).
KEYWORD
nonn
AUTHOR
John W. Nicholson, Oct 20 2019
STATUS
approved
Decimal expansion of sum of reciprocals of maximal prime gap primes: Sum_{n>=1} 1/A002386(n).
+20
0
1, 0, 4, 4, 7, 0, 0, 5, 8, 5, 0, 8, 1, 1, 9
OFFSET
1,3
EXAMPLE
1.04470058508119...
PROG
(PARI) B2386A = readvec("b002386.txt"); s=0; for(i=1, 80, s= 1/B2386A[i]+s); s*1.
\\ PARI's "readvec" doesn't work with the 2-column original OEIS b-file "b002386.txt". One needs to strip the index column first from b-file.
CROSSREFS
KEYWORD
nonn,cons,more
AUTHOR
John W. Nicholson, Jan 07 2022
STATUS
approved
Midpoints of record gaps between primes: a(n) = (A000101(n) + A002386(n))/2 for n > 1.
+20
0
4, 9, 26, 93, 120, 532, 897, 1140, 1344, 9569, 15705, 19635, 31433, 155964, 360701, 370317, 492170, 1349592, 1357267, 2010807, 4652430, 17051797, 20831428, 47326803, 122164858, 189695776, 191912907, 387096258, 436273150, 1294268635, 1453168287, 2300942709, 3842610941, 4302407536, 10726904850, 20678048489, 22367085156, 25056082315, 42652618575
OFFSET
2,1
CROSSREFS
Subsequence of A024675.
KEYWORD
nonn
AUTHOR
Donghwi Park, Jul 08 2022
STATUS
approved
pi(n), the number of primes <= n. Sometimes called PrimePi(n) to distinguish it from the number 3.14159...
(Formerly M0256 N0090)
+10
1995
0, 1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 21, 21, 21, 21, 21, 21
OFFSET
1,3
COMMENTS
Partial sums of A010051 (characteristic function of primes). - Jeremy Gardiner, Aug 13 2002
pi(n) and prime(n) are inverse functions: a(A000040(n)) = n and A000040(n) is the least number m such that A000040(a(m)) = A000040(n). A000040(a(n)) = n if (and only if) n is prime. - Jonathan Sondow, Dec 27 2004
See the additional references and links mentioned in A143227. - Jonathan Sondow, Aug 03 2008
A lower bound that gets better with larger N is that there are at least T prime numbers less than N, where the recursive function T is: T = N - N*Sum_{i=0..T(sqrt(N))} A005867(i)/A002110(i). - Ben Paul Thurston, Aug 23 2010
Number of partitions of 2n into exactly two parts with the smallest part prime. - Wesley Ivan Hurt, Jul 20 2013
Equivalent to the Riemann hypothesis: abs(a(n) - li(n)) < sqrt(n)*log(n)/(8*Pi), for n >= 2657, where li(n) is the logarithmic integral (Lowell Schoenfeld). - Ilya Gutkovskiy, Jul 05 2016
The second Hardy-Littlewood conjecture, that pi(x) + pi(y) >= pi(x + y) for integers x and y with min{x, y} >= 2, is known to hold for (x, y) sufficiently large (Udrescu 1975). - Peter Luschny, Jan 12 2021
REFERENCES
M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 870.
Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, p. 8.
Raymond Ayoub, An Introduction to the Analytic Theory of Numbers, Amer. Math. Soc., 1963; p. 129.
Richard Crandall and Carl Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001; see p. 5.
G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, Theorems 6, 7, 420.
G. J. O. Jameson, The Prime Number Theorem, Camb. Univ. Press, 2003. [See also the review by D. M. Bressoud (link below).]
Władysław Narkiewicz, The Development of Prime Number Theory, Springer-Verlag, 2000.
József Sándor, Dragoslav S. Mitrinovic and Borislav Crstici, Handbook of Number Theory I, Springer Science & Business Media, 2005, Section VII.1. (For inequalities, etc.).
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Gerald Tenenbaum and Michel Mendès France, Prime Numbers and Their Distribution, AMS Providence RI, 1999.
V. Udrescu, Some remarks concerning the conjecture pi(x + y) <= pi(x) + pi(y). Math. Pures Appl. 20 (1975), 1201-1208.
LINKS
Daniel Forgues, Table of n, pi(n) for n = 1..100000 (first 20000 terms from N. J. A. Sloane; see below for links with 823852 terms (Verma) and more (Caldwell))
M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards, Applied Math. Series 55, Tenth Printing, 1972 [alternative scanned copy].
Christian Axler, Über die Primzahl-Zählfunktion, die n-te Primzahl und verallgemeinerte Ramanujan-Primzahlen, Ph.D. thesis 2013, in German, English summary.
Paul T. Bateman and Harold G. Diamond, A Hundred Years of Prime Numbers, Amer. Math. Month., Vol. 103, No. 9 (Nov. 1996), pp. 729-741, MAA Washington DC.
Claudio Bonanno and Mirko S. Mega, Toward a dynamical model for prime numbers, Chaos, Solitons & Fractals, Vol. 20, No. 1 (2004), pp. 107-118; arXiv preprint, arXiv:cond-mat/0309251, 2003.
David M. Bressoud, Review of "The Prime Number Theorem" by G. J. O. Jameson, MAA Reviews, 2005. - from N. J. A. Sloane, Dec 29 2018
D. M. Bressoud and Stan Wagon, Computational Number Theory: Basic Algorithms, Springer/Key, 2000 (with a Mathematica package for computational number theory).
Jean-Marie de Koninck and Aleksandar Ivić, Topics in Arithmetical Functions: Asymptotic Formulae for Sums of Reciprocals of Arithmetical Functions and Related Fields, Amsterdam, Netherlands: North-Holland, 1980. See Chapter 9, p. 231.
Marc Deléglise, Computation of large values of pi(x), 1996.
Pierre Dusart, Autour de la fonction qui compte le nombre de nombres premiers, Thèse, Université de Limoges, France (1998).
Pierre Dusart, The k-th prime is greater than k(ln k + ln ln k-1) for k>=2, Mathematics of Computation, Vo. 68, No. 225 (1999), pp. 411-415.
Encyclopedia Britannica, The Prime Number Theorem [web.archive.org's copy of a no longer available personal copy of the Encyclopedia's article]
R. Gray and J. D. Mitchell, Largest subsemigroups of the full transformation monoid, Discrete Math., 308 (2008), 4801-4810.
G. H. Hardy and J. E. Littlewood, Contributions to the theory of the Riemann zeta-function and the theory of the distribution of primes, Acta Mathematica, Vol. 41 (1916), pp. 119-196.
G. H. Hardy and J. E. Littlewood, Some problems of 'Partitio numerorum'; III: On the expression of a number as a sum of primes, Acta Math., Vol. 44, No. 1 (1923), pp. 1-70.
Mehdi Hassani, Approximation of pi(x) by Psi(x), J. Inequ. Pure Appl. Math., Vol. 7, No. 1 (2006), Article #7.
Y.-C. Kim, Note on the Prime Number Theorem, arXiv:math/0502062 [math.NT], 2005.
Angel V. Kumchev, The Distribution of Prime Numbers, 2005.
J. C. Lagarias, V. S. Miller and A. M. Odlyzko, Computing pi(x): The Meissel-Lehmer method, Math. Comp., Vol. 44, No. 170 (1985), pp. 537-560.
Jeffrey C. Lagarias and Andrew M. Odlyzko, Computing pi(x): An analytic method, Journal of Algorithms, Vol. 8, No. 2 (1987), pp. 173-191; alternative link.
John Lorch, The Distribution of Primes, B.S. Undergraduate Mathematics Exchange, Vol. 3, No. 1 (Fall 2005).
Nathan McKenzie, Computing the Prime Counting Function with Linnik's Identity, personal blog, March 24, 2011.
Murat Baris Paksoy, Derived Ramanujan primes: R'_n, arXiv:1210.6991 [math.NT], 2012.
Bent E. Petersen, Prime Number Theorem, Seminar Lecture Note, 1996; version 2002-05-14.
Simon Plouffe, Approximations de séries génératrices et quelques conjectures, Dissertation, Université du Québec à Montréal, 1992; arXiv:0911.4975 [math.NT], 2009.
Simon Plouffe, 1031 Generating Functions, Appendix to Thesis, Montreal, 1992
Bernhard Riemann, On the Number of Prime Numbers, 1859, last page (various transcripts)
J. Barkley Rosser, Explicit Bounds for Some Functions of Prime Numbers, American Journal of Mathematics, Vol. 63, No. 1 (1941), pp. 211-232.
J. Barkley Rosser and Lowell Schoenfeld, Approximate formulas for some functions of prime numbers, Ill. Journ. Math. 6 (1962) 64-94.
J. Barkley Rosser and Lowell Schoenfeld, Approximate formulas for some functions of prime numbers (scan of some key pages from an ancient annotated photocopy).
Sebastian Martin Ruiz and Jonathan Sondow, Formulas for pi(n) and the n-th prime, arXiv:math/0210312 [math.NT], 2002, 2014.
Jonathan Sondow, Ramanujan Primes and Bertrand's Postulate, The American Mathematical Monthly, Vol. 116, No. 7 (2009), pp. 630-635; arXiv preprint, arXiv:0907.5232 [math.NT], 2009-2010.
Igor Turkanov, The prime counting function, arXiv:1603.02914 [math.NT], 2016.
Gaurav Verma and Srujan Sapkal, Table of n, pi(n) for n = 1..823852.
Eric Weisstein's World of Mathematics, Prime Counting Function.
Marek Wolf, Applications of Statistical Mechanics in Number Theory, Physica A, vol. 274, no. 2, 1999, pp. 149-157; 1999 preprint.
Wolfram Research, First 50 values of pi(n).
FORMULA
The prime number theorem gives the asymptotic expression a(n) ~ n/log(n).
For x > 1, pi(x) < (x / log x) * (1 + 3/(2 log x)). For x >= 59, pi(x) > (x / log x) * (1 + 1/(2 log x)). [Rosser and Schoenfeld]
For x >= 355991, pi(x) < (x / log(x)) * (1 + 1/log(x) + 2.51/(log(x))^2 ). For x >= 599, pi(x) > (x / log(x)) * (1 + 1/log(x)). [Dusart]
For x >= 55, x/(log(x) + 2) < pi(x) < x/(log(x) - 4). [Rosser]
For n > 1, A138194(n) <= a(n) <= A138195(n) (Tschebyscheff, 1850). - Reinhard Zumkeller, Mar 04 2008
For n >= 33, a(n) = 1 + Sum_{j=3..n} ((j-2)! - j*floor((j-2)!/j)) (Hardy and Wright); for n >= 1, a(n) = n - 1 + Sum_{j=2..n} (floor((2 - Sum_{i=1..j} (floor(j/i)-floor((j-1)/i)))/j)) (Ruiz and Sondow 2000). - Benoit Cloitre, Aug 31 2003
a(n) = A001221(A000142(n)). - Benoit Cloitre, Jun 03 2005
G.f.: Sum_{p prime} x^p/(1-x) = b(x)/(1-x), where b(x) is the g.f. for A010051. - Franklin T. Adams-Watters, Jun 15 2006
a(n) = A036234(n) - 1. - Jaroslav Krizek, Mar 23 2009
From Enrique Pérez Herrero, Jul 12 2010: (Start)
a(n) = Sum_{i=2..n} floor((i+1)/A000203(i)).
a(n) = Sum_{i=2..n} floor(A000010(n)/(i-1)).
a(n) = Sum_{i=2..n} floor(2/A000005(n)). (End)
Let pf(n) denote the set of prime factors of an integer n. Then a(n) = card(pf(n!/floor(n/2)!)). - Peter Luschny, Mar 13 2011
a(n) = -Sum_{p <= n} mu(p). - Wesley Ivan Hurt, Jan 04 2013
a(n) = (1/2)*Sum_{p <= n} (mu(p)*d(p)*sigma(p)*phi(p)) + sum_{p <= n} p^2. - Wesley Ivan Hurt, Jan 04 2013
a(1) = 0 and then, for all k >= 1, repeat k A001223(k) times. - Jean-Christophe Hervé, Oct 29 2013
a(n) = n/(log(n) - 1 - Sum_{k=1..m} A233824(k)/log(n)^k + O(1/log(n)^{m+1})) for m > 0. - Jonathan Sondow, Dec 19 2013
a(n) = A001221(A003418(n)). - Eric Desbiaux, May 01 2014
a(n) = Sum_{j=2..n} H(-sin^2 (Pi*(Gamma(j)+1)/j)) where H(x) is the Heaviside step function, taking H(0)=1. - Keshav Raghavan, Jun 18 2016
a(A014076(n)) = (1/2) * (A014076(n) + 1) - n + 1. - Christopher Heiling, Mar 03 2017
From Steven Foster Clark, Sep 25 2018: (Start)
a(n) = Sum_{m=1..n} A143519(m) * floor(n/m).
a(n) = Sum_{m=1..n} A001221(m) * A002321(floor(n/m)) where A002321() is the Mertens function.
a(n) = Sum_{m=1..n} |A143519(m)| * A002819(floor(n/m)) where A002819() is the Liouville Lambda summatory function and |x| is the absolute value of x.
a(n) = Sum_{m=1..n} A137851(m)/m * H(floor(n/m)) where H(n) = Sum_{m=1..n} 1/m is the harmonic number function.
a(n) = Sum_{m=1..log_2(n)} A008683(m) * A025528(floor(n^(1/m))) where A008683() is the Moebius mu function and A025528() is the prime-power counting function.
(End)
Sum_{k=2..n} 1/a(k) ~ (1/2) * log(n)^2 + O(log(n)) (de Koninck and Ivić, 1980). - Amiram Eldar, Mar 08 2021
a(n) ~ 1/(n^(1/n)-1). - Thomas Ordowski, Jan 30 2023
EXAMPLE
There are 3 primes <= 6, namely 2, 3 and 5, so pi(6) = 3.
MAPLE
with(numtheory); A000720 := pi; [ seq(A000720(i), i=1..50) ];
MATHEMATICA
A000720[n_] := PrimePi[n]; Table[ A000720[n], {n, 1, 100} ]
Array[ PrimePi[ # ]&, 100 ]
Accumulate[Table[Boole[PrimeQ[n]], {n, 100}]] (* Harvey P. Dale, Jan 17 2015 *)
PROG
(PARI) A000720=vector(100, n, omega(n!)) \\ For illustration only; better use A000720=primepi
(PARI) vector(300, j, primepi(j)) \\ Joerg Arndt, May 09 2008
(Sage) [prime_pi(n) for n in range(1, 79)] # Zerinvary Lajos, Jun 06 2009
(Magma) [ #PrimesUpTo(n): n in [1..200] ]; // Bruno Berselli, Jul 06 2011
(Haskell)
a000720 n = a000720_list !! (n-1)
a000720_list = scanl1 (+) a010051_list -- Reinhard Zumkeller, Sep 15 2011
(Python)
from sympy import primepi
for n in range(1, 100): print(primepi(n), end=', ') # Stefano Spezia, Nov 30 2018
CROSSREFS
Closely related:
A099802: Number of primes <= 2n.
A060715: Number of primes between n and 2n (exclusive).
A035250: Number of primes between n and 2n (inclusive).
A038107: Number of primes < n^2.
A014085: Number of primes between n^2 and (n+1)^2.
A007053: Number of primes <= 2^n.
A036378: Number of primes p between powers of 2, 2^n < p <= 2^(n+1).
A006880: Number of primes < 10^n.
A006879: Number of primes with n digits.
A033270: Number of odd primes <= n.
A065855: Number of composites <= n.
For lists of large values of a(n) see, e.g., A005669(n) = a(A002386(n)), A214935(n) = a(A205827(n)).
Related sequences:
Primes (p) and composites (c): A000040, A002808, A065855.
Primes between p(n) and 2*p(n): A063124, A070046; between c(n) and 2*c(n): A376761; between n and 2*n: A035250, A060715, A077463, A108954.
Composites between p(n) and 2*p(n): A246514; between c(n) and 2*c(n): A376760; between n and 2*n: A075084, A307912, A307989, A376759.
KEYWORD
nonn,core,easy,nice
EXTENSIONS
Additional links contributed by Lekraj Beedassy, Dec 23 2003
Edited by M. F. Hasler, Apr 27 2018 and (links recovered) Dec 21 2018
STATUS
approved
a(0)=2; for n>=1, a(n) = smallest prime p such that there is a gap of exactly 2n between p and next prime, or -1 if no such prime exists.
(Formerly M2685 N1075)
+10
107
2, 3, 7, 23, 89, 139, 199, 113, 1831, 523, 887, 1129, 1669, 2477, 2971, 4297, 5591, 1327, 9551, 30593, 19333, 16141, 15683, 81463, 28229, 31907, 19609, 35617, 82073, 44293, 43331, 34061, 89689, 162143, 134513, 173359, 31397, 404597, 212701, 188029, 542603, 265621, 461717, 155921, 544279, 404851, 927869, 1100977, 360653, 604073
OFFSET
0,1
COMMENTS
p + 1 = A045881(n) starts the smallest run of exactly 2n-1 successive composite numbers. - Lekraj Beedassy, Apr 23 2010
Weintraub gives upper bounds on a(252), a(255), a(264), a(273), and a(327) based on a search from 1.1 * 10^16 to 1.1 * 10^16 + 1.5 * 10^9, probably performed on a 1970s microcomputer. - Charles R Greathouse IV, Aug 26 2022
REFERENCES
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Hugo Pfoertner, Table of n, a(n) for n = 0..672, extracted from T. Olivera e Silva's webpage.
L. J. Lander and T. R. Parkin, On the first appearance of prime differences, Math. Comp., 21 (1967), 483-488.
Thomas R. Nicely, First occurrence prime gaps [For local copy see A000101]
Tomás Oliveira e Silva, Gaps between consecutive primes
Sol Weintraub, A large prime gap, Mathematics of Computation Vol. 36, No. 153 (Jan 1981), p. 279.
J. Young and A. Potler, First occurrence prime gaps, Math. Comp., 52 (1989), 221-224.
Yitang Zhang, Bounded gaps between primes, Annals of Mathematics, Volume 179 (2014), Issue 3, pp. 1121-1174.
FORMULA
a(n) = A000040(A038664(n)). - Lekraj Beedassy, Sep 09 2006
EXAMPLE
The following table, based on a very much larger table in the web page of Tomás Oliveira e Silva (see link) shows, for each gap g, P(g) = the smallest prime such that P(g)+g is the smallest prime number larger than P(g);
* marks a record-holder: g is a record-holder if P(g') > P(g) for all (even) g' > g, i.e., if all prime gaps are smaller than g for all primes smaller than P(g); P(g) is a record-holder if P(g') < P(g) for all (even) g' < g.
This table gives rise to many sequences: P(g) is A000230, the present sequence; P(g)* is A133430; the positions of the *'s in the P(g) column give A100180, A133430; g* is A005250; P(g*) is A002386; etc.
-----
g P(g)
-----
1* 2*
2* 3*
4* 7*
6* 23*
8* 89*
10 139*
12 199*
14* 113
16 1831*
18* 523
20* 887
22* 1129
24 1669
26 2477*
28 2971*
30 4297*
32 5591*
34* 1327
36* 9551*
........
The first time a gap of 4 occurs between primes is between 7 and 11, so a(2)=7 and A001632(2)=11.
MATHEMATICA
Join[{2}, With[{pr = Partition[Prime[Range[86000]], 2, 1]}, Transpose[ Flatten[ Table[Select[pr, #[[2]] - #[[1]] == 2n &, 1], {n, 50}], 1]][[1]]]] (* Harvey P. Dale, Apr 20 2012 *)
PROG
(PARI) a(n)=my(p=2); forprime(q=3, , if(q-p==2*n, return(p)); p=q) \\ Charles R Greathouse IV, Nov 20 2012
(Perl) use ntheory ":all"; my($l, $i, @g)=(2, 0); forprimes { $g[($_-$l) >> 1] //= $l; while (defined $g[$i]) { print "$i $g[$i]\n"; $i++; } $l=$_; } 1e10; # Dana Jacobsen, Mar 29 2019
(Python)
import numpy
from sympy import sieve as prime
aupto = 50
A000230 = np.zeros(aupto+1, dtype=object)
A000230[0], it = 2, 2
while all(A000230) == 0:
gap = (prime[it+1] - prime[it]) // 2
if gap <= aupto and A000230[gap] == 0: A000230[gap] = prime[it]
it += 1
print(list(A000230)) # Karl-Heinz Hofmann, Jun 07 2023
CROSSREFS
A001632(n) = 2n + a(n) = nextprime(a(n)).
Cf. A100964 (least prime number that begins a prime gap of at least 2n).
KEYWORD
nonn,nice
EXTENSIONS
a(29)-a(37) from Jud McCranie, Dec 11 1999
a(38)-a(49) from Robert A. Stump (bee_ess107(AT)yahoo.com), Jan 11 2002
"or -1 if ..." added to definition at the suggestion of Alexander Wajnberg by N. J. A. Sloane, Feb 02 2020
STATUS
approved
Record gaps between primes.
(Formerly M0994)
+10
66
1, 2, 4, 6, 8, 14, 18, 20, 22, 34, 36, 44, 52, 72, 86, 96, 112, 114, 118, 132, 148, 154, 180, 210, 220, 222, 234, 248, 250, 282, 288, 292, 320, 336, 354, 382, 384, 394, 456, 464, 468, 474, 486, 490, 500, 514, 516, 532, 534, 540, 582, 588, 602, 652
OFFSET
1,2
COMMENTS
Here a "gap" means prime(n+1) - prime(n), but in other references it can mean prime(n+1) - prime(n) - 1.
a(n+1)/a(n) <= 2, for all n <= 80, and a(n+1)/a(n) < 1 + f(n)/a(n) with f(n)/a(n) <= epsilon for some function f(n) and with 0 < epsilon <= 1. It also appears, with the small amount of data available, for all n <= 80, that a(n+1)/a(n) ~ 1. - John W. Nicholson, Jun 08 2014, updated Aug 05 2019
Equivalent to the above statement, A053695(n) = a(n+1) - a(n) <= a(n). - John W. Nicholson, Jan 20 2016
Conjecture: a(n) = O(n^2); specifically, a(n) <= n^2. - Alexei Kourbatov, Aug 05 2017
Conjecture: below the k-th prime, the number of maximal gaps is about 2*log(k), i.e., about twice as many as the expected number of records in a sequence of k i.i.d. random variables (see arXiv:1709.05508 for a heuristic explanation). - Alexei Kourbatov, Mar 16 2018
REFERENCES
B. C. Berndt, Ramanujan's Notebooks Part IV, Springer-Verlag, see p. 133.
R. K. Guy, Unsolved Problems in Number Theory, A8.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Brian Kehrig, Table of n, a(n) for n = 1..83 (first 77 terms from John W. Nicholson, terms n=78..80 added by Rodolfo Ruiz-Huidobro)
Jens Kruse Andersen and Norman Luhn, Record Prime Gaps
R. P. Brent, J. H. Osborn and W. D. Smith, Lower bounds on maximal determinants of +-1 matrices via the probabilistic method, arXiv preprint arXiv:1211.3248 [math.CO], 2012.
C. K. Caldwell, Table of prime gaps
C. K. Caldwell, Gaps up to 1132
Alexei Kourbatov, Maximal gaps between prime k-tuples: a statistical approach, arXiv preprint arXiv:1301.2242 [math.NT], 2013 and J. Int. Seq. 16 (2013) #13.5.2.
Alexei Kourbatov, Tables of record gaps between prime constellations, arXiv preprint arXiv:1309.4053 [math.NT], 2013.
Alexei Kourbatov, The distribution of maximal prime gaps in Cramer's probabilistic model of primes, arXiv preprint arXiv:1401.6959 [math.NT], 2014.
Alexei Kourbatov, On the distribution of maximal gaps between primes in residue classes, arXiv preprint arXiv:1610.03340 [math.NT], 2016.
Alexei Kourbatov and Marek Wolf, Predicting maximal gaps in sets of primes, arXiv:1901.03785 [math.NT], 2019.
Ya-Ping Lu and Shu-Fang Deng, An upper bound for the prime gap, arXiv:2007.15282 [math.GM], 2020.
Thomas R. Nicely, First occurrence prime gaps [For local copy see A000101]
Tomás Oliveira e Silva, Gaps between consecutive primes
D. Shanks, On maximal gaps between successive primes, Mathematics of Computation, 18(88), 646-651. (1964).
Eric Weisstein's World of Mathematics, Prime Gaps
Wikipedia, Prime gap
Robert G. Wilson v, Notes (no date)
Marek Wolf, A Note on the Andrica Conjecture, arXiv:1010.3945 [math.NT], 2010.
J. Young and A. Potler, First occurrence prime gaps, Math. Comp., 52 (1989), 221-224.
FORMULA
a(n) = A000101(n) - A002386(n) = A008996(n-1) + 1. - M. F. Hasler, Dec 13 2007
a(n+1) = 1 + Sum_{i=1..n} A053695(i). - John W. Nicholson, Jan 20 2016
MATHEMATICA
nn=10^7; Module[{d=Differences[Prime[Range[nn]]], ls={1}}, Table[If[d[[n]]> Last[ls], AppendTo[ls, d[[n]]]], {n, nn-1}]; ls] (* Harvey P. Dale, Jul 23 2012 *)
DeleteDuplicates[Differences[Prime[Range[10^7]]], GreaterEqual] (* The program generates the first 26 terms of the sequence. *) (* Harvey P. Dale, May 12 2022 *)
PROG
(PARI) p=q=2; g=0; until( g<(q=nextprime(1+p=q))-p & print1(g=q-p, ", "), ) \\ M. F. Hasler, Dec 13 2007
(PARI) p=2; g=0; m=g; forprime(q=3, 10^13, g=q-p; if(g>m, print(g", ", p, ", ", q); m=g); p=q) \\ John W. Nicholson, Dec 18 2016
(Haskell)
a005250 n = a005250_list !! (n-1)
a005250_list = f 0 a001223_list
where f m (x:xs) = if x <= m then f m xs else x : f x xs
-- Reinhard Zumkeller, Dec 12 2012
CROSSREFS
Records in A001223. For positions of records see A005669.
KEYWORD
nonn,nice
AUTHOR
EXTENSIONS
More terms from Andreas Boerner (andreas.boerner(AT)altavista.net), Jul 11 2000
Additional comments from Frank Ellermann, Apr 20 2001
More terms from Robert G. Wilson v, Jan 03 2002, May 01 2006
STATUS
approved

Search completed in 0.061 seconds