OFFSET
1,1
COMMENTS
See the links by Jens Kruse Andersen et al. for very large gaps.
REFERENCES
B. C. Berndt, Ramanujan's Notebooks Part IV, Springer-Verlag, see p. 133.
D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 3, Sect 6.1, Table 1.
M. Kraitchik, Recherches sur la Théorie des Nombres. Gauthiers-Villars, Paris, Vol. 1, 1924, Vol. 2, 1929, see Vol. 1, p. 14.
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 M. F. Hasler and N. J. A. Sloane, terms n = 76..77 added by Charles R Greathouse IV)
R. K. Guy, Letter to N. J. A. Sloane, Aug 1986
R. K. Guy, Letter to N. J. A. Sloane, 1987
Lutz Kämmerer, A fast probabilistic component-by-component construction of exactly integrating rank-1 lattices and applications, arXiv:2012.14263 [math.NA], 2020.
Jens Kruse Andersen and Norman Luhn, Record Prime Gaps
Alexei Kourbatov, Tables of record gaps between prime constellations, arXiv preprint arXiv:1309.4053 [math.NT], 2013.
Alexei Kourbatov, Upper bounds for prime gaps related to Firoozbakht's conjecture, arXiv:1506.03042 [math.NT], 2015; and J. Int. Seq. 18 (2015) #15.11.2.
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 [For local copy see A000101]
Thomas R. Nicely, New maximal prime gaps and first occurrences, Math. Comput. 68,227 (1999) 1311-1315.
Tomás Oliveira e Silva, Gaps between consecutive primes
D. Shanks, On maximal gaps between successive primes, Math. Comp., 18 (1964), 646-651.
Matt Visser, Verifying the Firoozbakht, Nicholson, and Farhadian conjectures up to the 81st maximal prime gap, arXiv:1904.00499 [math.NT], 2019.
Eric Weisstein's World of Mathematics, Prime Gaps
Wikipedia, Prime gap
Robert G. Wilson v, Notes (no date)
J. Young and A. Potler, First occurrence prime gaps, Math. Comp., 52 (1989), 221-224.
FORMULA
MATHEMATICA
s = {2}; gm = 1; Do[p = Prime[n]; g = Prime[n + 1] - p; If[g > gm, Print[p]; AppendTo[s, p]; gm = g], {n, 2, 1000000}]; s (* Jean-François Alcover, Mar 31 2011 *)
Module[{nn=10^7, pr, df}, pr=Prime[Range[nn]]; df=Differences[pr]; DeleteDuplicates[ Thread[ {Most[ pr], df}], GreaterEqual[#1[[2]], #2[[2]]]&]][[All, 1]] (* The program generates the first 26 terms of the sequence. *) (* Harvey P. Dale, Sep 24 2022 *)
PROG
(PARI) a(n)=local(p, g); if(n<2, 2*(n>0), p=a(n-1); g=nextprime(p+1)-p; while(p=nextprime(p+1), if(nextprime(p+1)-p>g, break)); p) /* Michael Somos, Feb 07 2004 */
(PARI) p=q=2; g=0; until( g<(q=nextprime(1+p=q))-p && print1(q-g=q-p, ", "), ) \\ M. F. Hasler, Dec 13 2007
CROSSREFS
KEYWORD
nonn,nice,changed
AUTHOR
EXTENSIONS
Definition clarified by Harvey P. Dale, Sep 24 2022
STATUS
approved