A002386
Primes (lower end) with record gaps to the next consecutive prime: primes p(k) where p(k+1) - p(k) exceeds p(j+1) - p(j) for all j < k.
Original entry on oeis.org
2, 3, 7, 23, 89, 113, 523, 887, 1129, 1327, 9551, 15683, 19609, 31397, 155921, 360653, 370261, 492113, 1349533, 1357201, 2010733, 4652353, 17051707, 20831323, 47326693, 122164747, 189695659, 191912783, 387096133, 436273009, 1294268491
Offset: 1
- 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).
- 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.
- Index entries for primes, gaps between
-
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 *)
-
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 */
-
p=q=2;g=0;until( g<(q=nextprime(1+p=q))-p && print1(q-g=q-p,","),) \\ M. F. Hasler, Dec 13 2007
A008996
Increasing length runs of consecutive composite numbers (records).
Original entry on oeis.org
1, 3, 5, 7, 13, 17, 19, 21, 33, 35, 43, 51, 71, 85, 95, 111, 113, 117, 131, 147, 153, 179, 209, 219, 221, 233, 247, 249, 281, 287, 291, 319, 335, 353, 381, 383, 393, 455, 463, 467, 473, 485, 489, 499, 513, 515, 531, 533, 539, 581, 587, 601, 651, 673, 715, 765
Offset: 1
Mark Cramer (m.cramer(AT)qut.edu.au), Mar 15 1996
- 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
- Index entries for primes, gaps between
-
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
-
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 *)
A008995
Increasing length runs of consecutive composite numbers (endpoints).
Original entry on oeis.org
4, 10, 28, 96, 126, 540, 906, 1150, 1360, 9586, 15726, 19660, 31468, 156006, 360748, 370372, 492226, 1349650, 1357332, 2010880, 4652506, 17051886, 20831532, 47326912, 122164968, 189695892, 191913030
Offset: 1
Mark Cramer (m.cramer(AT)qut.edu.au). Computed by Dennis Yelle (dennis(AT)netcom.com)
- Netnews group rec.puzzles, circa Mar 01 1996 (I would like to get the exact reference).
-
maxGap = 1; Reap[ Do[ gap = Prime[n + 1] - (p = Prime[n]); If[gap > maxGap, Print[p + gap - 1]; Sow[p + gap - 1]; maxGap = gap], {n, 2, 10^8}]][[2, 1]] (* Jean-François Alcover, Jun 12 2013 *)
A030296
Smallest start for a run of at least n composite numbers.
Original entry on oeis.org
4, 8, 8, 24, 24, 90, 90, 114, 114, 114, 114, 114, 114, 524, 524, 524, 524, 888, 888, 1130, 1130, 1328, 1328, 1328, 1328, 1328, 1328, 1328, 1328, 1328, 1328, 1328, 1328, 9552, 9552, 15684, 15684, 15684, 15684, 15684, 15684, 15684, 15684, 19610, 19610, 19610
Offset: 1
a(5) = 24 as 24 is the first of the five consecutive composite numbers 24, 25, 26, 27, 28.
- Amarnath Murthy, Some more conjectures on primes and divisors, Smarandache Notions Journal, Vol. 12, No. 1-2-3, Spring 2001.
-
a[n_] := a[n] = For[p1 = a[n-1]-1; p2 = NextPrime[p1], True, p1 = p2; p2 = NextPrime[p1], If[ p2-p1-1 >= n, Return[p1+1]]]; a[1] = 4; Table[a[n], {n, 1, 43}] (* Jean-François Alcover, May 24 2012 *)
Module[{nn=20000,cmps},cmps=Table[If[CompositeQ[n],1,0],{n,nn}];Table[ SequencePosition[ cmps,PadRight[{},k,1],1][[1,1]],{k,50}]] (* Harvey P. Dale, Jan 01 2022 *)
A056784
First nonprime in a sequence of consecutive nonprimes which is at least twice as long as any earlier run of consecutive nonprimes in this list.
Original entry on oeis.org
1, 8, 90, 524, 9552, 31398, 2010734, 2300942550, 2614941710600, 352521223451364324
Offset: 1
2300942550 is the first of 319 consecutive composite numbers.
2614941710600 is the first of 651 consecutive composite numbers.
352521223451364324 is the first of 1327 consecutive composite numbers.
A383969
a(n) is the smallest even number m such that the set {m+1, m+3, m+5, ..., m+(2*n-1)} contains no prime numbers.
Original entry on oeis.org
0, 24, 90, 114, 114, 114, 524, 524, 888, 1130, 1328, 1328, 1328, 1328, 1328, 1328, 9552, 15684, 15684, 15684, 15684, 19610, 19610, 19610, 19610, 31398, 31398, 31398, 31398, 31398, 31398, 31398, 31398, 31398, 31398, 155922, 155922, 155922, 155922, 155922, 155922, 155922
Offset: 1
a(1) = 0 since 0 is the smallest even number such that 0 + 1 = 1 is not prime
a(2) = 24 since there are no primes in {24+1, 24+3} = {25, 27} and no smaller even number has this property.
a(3) = 90 since there are no primes in {91, 93, 95}, and no smaller even number has this property.
-
k = 0; Table[While[AnyTrue[k + Range[2*n - 1], PrimeQ], k += 2]; k, {n, 42}] (* Michael De Vlieger, Jun 01 2025 *)
-
from sympy import isprime
from itertools import count
def a(n): return next(m for m in count(0, 2) if all(not isprime(m+2*i+1) for i in range(n)))
print([a(n) for n in range(1, 43)]) # Michael S. Branicky, May 23 2025
A175839
Smallest runs of n*2-1 consecutive composites.
Original entry on oeis.org
4, 8, 9, 10, 24, 25, 26, 27, 28, 90, 91, 92, 93, 94, 95, 96, 114, 115, 116, 117, 118, 119, 120, 121, 122, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126
Offset: 1
Run 1 has length 1; the first composite is 4.
Run 2 has length 3; the first three consecutive composites are 8, 9, and 10.
Run 3 has length 5; the first five consecutive composites are 24, 25, 26, 27, and 28.
4;
8, 9, 10;
24, 25, 26, 27, 28;
90, 91, 92, 93, 94, 95, 96;
114, 115, 116, 117, 118, 119, 120, 121, 122;
114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124;
114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126;
Showing 1-7 of 7 results.
Comments