%I M0994 #241 Sep 10 2024 03:56:57
%S 1,2,4,6,8,14,18,20,22,34,36,44,52,72,86,96,112,114,118,132,148,154,
%T 180,210,220,222,234,248,250,282,288,292,320,336,354,382,384,394,456,
%U 464,468,474,486,490,500,514,516,532,534,540,582,588,602,652
%N Record gaps between primes.
%C Here a "gap" means prime(n+1) - prime(n), but in other references it can mean prime(n+1) - prime(n) - 1.
%C 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
%C Equivalent to the above statement, A053695(n) = a(n+1) - a(n) <= a(n). - _John W. Nicholson_, Jan 20 2016
%C Conjecture: a(n) = O(n^2); specifically, a(n) <= n^2. - _Alexei Kourbatov_, Aug 05 2017
%C 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
%D B. C. Berndt, Ramanujan's Notebooks Part IV, Springer-Verlag, see p. 133.
%D R. K. Guy, Unsolved Problems in Number Theory, A8.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H John W. Nicholson, <a href="/A005250/b005250.txt">Table of n, a(n) for n = 1..82</a> (first 77 from John W. Nicholson, terms n=78..80 from Rodolfo Ruiz-Huidobro)
%H Jens Kruse Andersen, <a href="http://primerecords.dk/primegaps/gaps20.htm">The Top-20 Prime Gaps</a>
%H Jens Kruse Andersen, <a href="http://primerecords.dk/primegaps/megagap2.htm">New record prime gap</a>
%H Jens Kruse Andersen, <a href="http://primerecords.dk/primegaps/maximal.htm">Maximal gaps</a>
%H Alex Beveridge, <a href="/A005250/a005250.txt">Table giving known values of A000101(n), A005250(n), A107578(n)</a>
%H R. P. Brent, J. H. Osborn and W. D. Smith, <a href="http://arxiv.org/abs/1211.3248">Lower bounds on maximal determinants of +-1 matrices via the probabilistic method</a>, arXiv preprint arXiv:1211.3248 [math.CO], 2012.
%H C. K. Caldwell, <a href="http://www.utm.edu/research/primes/notes/gaps.html#table">Table of prime gaps</a>
%H C. K. Caldwell, <a href="http://www.utm.edu/research/primes/notes/GapsTable.html">Gaps up to 1132</a>
%H R. K. Guy, <a href="/A000978/a000978.pdf">Letter to N. J. A. Sloane, Aug 1986</a>
%H R. K. Guy, <a href="/A005667/a005667.pdf">Letter to N. J. A. Sloane, 1987</a>
%H Lutz Kämmerer, <a href="https://arxiv.org/abs/2012.14263">A fast probabilistic component-by-component construction of exactly integrating rank-1 lattices and applications</a>, arXiv:2012.14263 [math.NA], 2020.
%H Alexei Kourbatov, <a href="http://arxiv.org/abs/1301.2242">Maximal gaps between prime k-tuples: a statistical approach</a>, arXiv preprint arXiv:1301.2242 [math.NT], 2013 and <a href="https://cs.uwaterloo.ca/journals/JIS/VOL16/Kourbatov/kourbatov3.html">J. Int. Seq. 16 (2013) #13.5.2</a>.
%H Alexei Kourbatov, <a href="http://arxiv.org/abs/1309.4053">Tables of record gaps between prime constellations</a>, arXiv preprint arXiv:1309.4053 [math.NT], 2013.
%H Alexei Kourbatov, <a href="http://arxiv.org/abs/1401.6959">The distribution of maximal prime gaps in Cramer's probabilistic model of primes</a>, arXiv preprint arXiv:1401.6959 [math.NT], 2014.
%H Alexei Kourbatov, <a href="http://arxiv.org/abs/1506.03042">Upper bounds for prime gaps related to Firoozbakht's conjecture</a>, arXiv:1506.03042 [math.NT], 2015; and <a href="https://cs.uwaterloo.ca/journals/JIS/VOL18/Kourbatov/kourb7.html">J. Int. Seq. 18 (2015) #15.11.2</a>.
%H Alexei Kourbatov, <a href="http://arxiv.org/abs/1503.01744">Verification of the Firoozbakht conjecture for primes up to four quintillion</a>, arXiv:1503.01744 [math.NT], 2015; and <a href="http://dx.doi.org/10.12988/imf.2015.5322">Int. Math. Forum, 10 (2015), 283-288</a>.
%H Alexei Kourbatov, <a href="https://arxiv.org/abs/1610.03340">On the distribution of maximal gaps between primes in residue classes</a>, arXiv preprint arXiv:1610.03340 [math.NT], 2016.
%H Alexei Kourbatov, <a href="https://arxiv.org/abs/1709.05508">On the nth record gap between primes in an arithmetic progression</a>, arXiv:1709.05508 [math.NT], 2017; and <a href="https://doi.org/10.12988/imf.2018.712103">Int. Math. Forum, 13 (2018), 65-78</a>.
%H Alexei Kourbatov and Marek Wolf, <a href="https://arxiv.org/abs/1901.03785">Predicting maximal gaps in sets of primes</a>, arXiv:1901.03785 [math.NT], 2019.
%H Ya-Ping Lu and Shu-Fang Deng, <a href="https://arxiv.org/abs/2007.15282">An upper bound for the prime gap</a>, arXiv:2007.15282 [math.GM], 2020.
%H Thomas R. Nicely, <a href="https://faculty.lynchburg.edu/~nicely/index.html">Some Results of Computational Research in Prime Numbers</a> [See local copy in A007053]
%H Thomas R. Nicely, <a href="https://faculty.lynchburg.edu/~nicely/gaps/gaplist.html">First occurrence prime gaps</a> [For local copy see A000101]
%H Tomás Oliveira e Silva, <a href="http://sweet.ua.pt/tos/gaps.html">Gaps between consecutive primes</a>
%H D. Shanks, <a href="http://dx.doi.org/10.1090/S0025-5718-1964-0167472-8">On maximal gaps between successive primes</a>, Mathematics of Computation, 18(88), 646-651. (1964).
%H Matt Visser, <a href="https://arxiv.org/abs/1904.00499">Verifying the Firoozbakht, Nicholson, and Farhadian conjectures up to the 81st maximal prime gap</a>, arXiv:1904.00499 [math.NT], 2019.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PrimeGaps.html">Prime Gaps</a>
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Prime_gap">Prime gap</a>
%H Robert G. Wilson v, <a href="/A005250/a005250.pdf">Notes (no date)</a>
%H Marek Wolf, <a href="http://arxiv.org/abs/1010.3945">A Note on the Andrica Conjecture</a>, arXiv:1010.3945 [math.NT], 2010.
%H J. Young and A. Potler, <a href="http://dx.doi.org/10.1090/S0025-5718-1989-0947470-1">First occurrence prime gaps</a>, Math. Comp., 52 (1989), 221-224.
%H <a href="/index/Pri#gaps">Index entries for primes, gaps between</a>
%F a(n) = A000101(n) - A002386(n) = A008996(n-1) + 1. - _M. F. Hasler_, Dec 13 2007
%F a(n+1) = 1 + Sum_{i=1..n} A053695(i). - _John W. Nicholson_, Jan 20 2016
%t 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 *)
%t DeleteDuplicates[Differences[Prime[Range[10^7]]],GreaterEqual] (* The program generates the first 26 terms of the sequence. *) (* _Harvey P. Dale_, May 12 2022 *)
%o (PARI) p=q=2;g=0;until( g<(q=nextprime(1+p=q))-p & print1(g=q-p,","),) \\ _M. F. Hasler_, Dec 13 2007
%o (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
%o (Haskell)
%o a005250 n = a005250_list !! (n-1)
%o a005250_list = f 0 a001223_list
%o where f m (x:xs) = if x <= m then f m xs else x : f x xs
%o -- _Reinhard Zumkeller_, Dec 12 2012
%Y Records in A001223. For positions of records see A005669.
%Y Cf. A000040, A002386, A000101, A008996, A058320, A107578.
%K nonn,nice
%O 1,2
%A _N. J. A. Sloane_, _R. K. Guy_, May 20 1991
%E More terms from Andreas Boerner (andreas.boerner(AT)altavista.net), Jul 11 2000
%E Additional comments from _Frank Ellermann_, Apr 20 2001
%E More terms from _Robert G. Wilson v_, Jan 03 2002, May 01 2006