OFFSET
1,2
COMMENTS
Conjecture: a(n) = O(n^2); specifically, a(n) <= n^2. - Alexei Kourbatov, Jan 23 2019
LINKS
Bert Sierra, Table of n, a(n) for n = 1..82 (derived from A005250; first 74 terms from Jens Kruse Andersen)
Jens Kruse Andersen, Maximal Prime Gaps
Alexei Kourbatov, On the nth record gap between primes in an arithmetic progression, arXiv:1709.05508 [math.NT], 2017; Int. Math. Forum, 13 (2018), 65-78.
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.
Eric Weisstein's World of Mathematics, Prime Gaps
FORMULA
a(n) = A005250(n+1) - 1.
MATHEMATICA
maxGap = 1; Reap[ Do[ gap = Prime[n+1] - Prime[n]; If[gap > maxGap, Print[gap-1]; Sow[gap-1]; maxGap = gap], {n, 2, 10^8}]][[2, 1]] (* Jean-François Alcover, Jun 12 2013 *)
Module[{nn=10^8, cmps}, cmps=Table[If[CompositeQ[n], 1, {}], {n, nn}]; DeleteDuplicates[ Rest[ Length/@ Split[cmps]], GreaterEqual]] (* The program generates the first 24 terms of the sequnece. To generate more, increase the nn constant. *) (* Harvey P. Dale, Sep 04 2022 *)
PROG
(Haskell)
a008996 n = a008996_list !! (n-1)
a008996_list = 1 : f 0 (filter (> 1) $
map length $ group $ drop 3 a010051_list)
where f m (u : us) = if u <= m then f m us else u : f u us
-- Reinhard Zumkeller, Nov 27 2012
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
Mark Cramer (m.cramer(AT)qut.edu.au), Mar 15 1996
EXTENSIONS
More terms from Warren D. Smith, Dec 11 2000
a(40) corrected by Bert Sierra, Jul 12 2025
STATUS
approved
