cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-8 of 8 results.

A046933 Number of composites between successive primes.

Original entry on oeis.org

0, 1, 1, 3, 1, 3, 1, 3, 5, 1, 5, 3, 1, 3, 5, 5, 1, 5, 3, 1, 5, 3, 5, 7, 3, 1, 3, 1, 3, 13, 3, 5, 1, 9, 1, 5, 5, 3, 5, 5, 1, 9, 1, 3, 1, 11, 11, 3, 1, 3, 5, 1, 9, 5, 5, 5, 1, 5, 3, 1, 9, 13, 3, 1, 3, 13, 5, 9, 1, 3, 5, 7, 5, 5, 3, 5, 7, 3, 7, 9, 1, 9, 1, 5, 3, 5, 7, 3, 1, 3, 11, 7, 3, 7, 3, 5, 11, 1, 17
Offset: 1

Views

Author

Marc LeBrun, Dec 11 1999

Keywords

Comments

a(n) is odd for n>1 since all primes except 2 are odd. - Joel Brennan, Jan 02 2023

Examples

			a(1) = 0 since 2 is adjacent to 3;
a(2) = 1 since 4 is between 3 and 5;
a(4) = 3 = 11 - 7 - 1, etc.
		

Crossrefs

Cf. A008996 (record values > 0).

Programs

Formula

a(n) = prime(n+1) - prime(n) - 1 = A000040(n+1) - A000040(n) - 1.
a(n) = A001223(n) - 1.
a(n) = 2*A028334(n) - 1 for n>1. - Giovanni Teofilatto, Apr 19 2010
a(n) = Sum_{i=1..n-1} A036263(i). - Daniel Forgues, Apr 07 2014

A005250 Record gaps between primes.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, R. K. Guy, May 20 1991

Keywords

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).

Crossrefs

Records in A001223. For positions of records see A005669.

Programs

  • 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
  • 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 *)
  • 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
    

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

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

A058320 Distinct even prime-gap lengths (number of composites between primes), from 3+2, 7+4, 23+6,...

Original entry on oeis.org

2, 4, 6, 8, 14, 10, 12, 18, 20, 22, 34, 24, 16, 26, 28, 30, 32, 36, 44, 42, 40, 52, 48, 38, 72, 50, 62, 54, 60, 58, 46, 56, 64, 68, 86, 66, 70, 78, 76, 82, 96, 112, 100, 74, 90, 84, 114, 80, 88, 98, 92, 106, 94, 118, 132, 104, 102, 110, 126, 120, 148, 108
Offset: 0

Views

Author

Warren D. Smith, Dec 11 2000

Keywords

Comments

Nicely and Nyman have sieved up to 1.3565*10^16 at least. They admit it is likely they have suffered from hardware or software bugs, but believe the probability the sequence up to this point is incorrect is <1 in a million. This sequence is presumably all even integers (in different order). It is not monotonic. The monotonic subsequence of record-breaking prime gaps is A005250.
Essentially the same as A014320. [From R. J. Mathar, Oct 13 2008]

Crossrefs

Equals 2*A014321(n-1).

Programs

  • Mathematica
    DeleteDuplicates[Differences[Prime[Range[2,200000]]]] (* Harvey P. Dale, Dec 07 2014 *)

Extensions

Comment corrected by Harvey P. Dale, Dec 07 2014

A008950 Increasing length runs of consecutive composite numbers (starting points).

Original entry on oeis.org

4, 8, 24, 90, 114, 524, 888, 1130, 1328, 9552, 15684, 19610, 31398, 155922, 360654, 370262, 492114, 1349534, 1357202, 2010734, 4652354, 17051708, 20831324, 47326694, 122164748, 189695660, 191912784, 387096134, 436273010, 1294268492
Offset: 1

Views

Author

Mark Cramer (m.cramer(AT)qut.edu.au). Computed by Dennis Yelle (dennis(AT)netcom.com)

Keywords

Comments

There are runs of n consecutive composite numbers for every n. For example, the n numbers (n+1)!+2 ... (n+1)!+n+1 are composite. Such a run may start of course earlier than this. - Joerg Arndt, May 01 2013

Crossrefs

Programs

  • Mathematica
    maxGap = 1; Reap[Do[p = Prime[n]; gap = Prime[n+1] - p; If[gap > maxGap, Print[p+1]; Sow[p+1]; maxGap = gap], {n, 2, 10^8 }]][[2, 1]] (* Jean-François Alcover, Jun 15 2012 *)

Formula

a(n) = A002386(n+1)+1.
a(n) <= (n+1)! + 2. [Joerg Arndt, May 01 2013]

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

Views

Author

Mark Cramer (m.cramer(AT)qut.edu.au). Computed by Dennis Yelle (dennis(AT)netcom.com)

Keywords

References

  • Netnews group rec.puzzles, circa Mar 01 1996 (I would like to get the exact reference).

Crossrefs

Programs

  • Mathematica
    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 *)

Formula

a(n) = A000101(n+1)-1.

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

Views

Author

Keywords

Comments

a(n) is even, since a(n)-1 is a prime > 2, by the minimality of a(n). - Jonathan Sondow, May 31 2014
Except for a(1), records occur at even values of n, and each term appears an even number of times consecutively. (Proof. A maximal run of composites must begin and end at even numbers.) - Jonathan Sondow, May 31 2014

Examples

			a(5) = 24 as 24 is the first of the five consecutive composite numbers 24, 25, 26, 27, 28.
		

References

  • Amarnath Murthy, Some more conjectures on primes and divisors, Smarandache Notions Journal, Vol. 12, No. 1-2-3, Spring 2001.

Crossrefs

Programs

  • Mathematica
    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 *)

Formula

a(n) = A104138(n) + 1. - Jonathan Sondow, May 31 2014

A084105 Middle q of three consecutive primes p,q,r, such that one adjacent prime is near, the other is far and the ratio of the differences (whichever of (r-q)/(q-p) or (q-p)/(r-q) is greater than 1) sets a record.

Original entry on oeis.org

3, 29, 113, 139, 199, 523, 1151, 1669, 2971, 6947, 10007, 16141, 25471, 40639, 79699, 102761, 173359, 265621, 404851, 838249, 1349533, 1562051, 6371537, 7230479, 27980987, 42082303, 53231051, 70396589, 192983851, 253878617, 390932389, 465828731, 516540163, 1692327137
Offset: 1

Views

Author

Hugo Pfoertner, May 29 2003

Keywords

Comments

Are there entries other than a(3) for which the smaller difference exceeds 2?

Examples

			a(3) = 113 because the ratio (113-109)/(127-113) = 2/7 = 0.28571.. is smaller than the previous minimum produced by (31-29)/(29-23) = 1/3 = 0.33333...
		

Crossrefs

Programs

  • PARI
    a084105(limit)={my(p1=2,p2=3,r=0);forprime(p3=5,limit,my(q=max((p2-p1)/(p3-p2),(p3-p2)/(p2-p1)));if(q>r,r=q;print1(p2,", "));p1=p2;p2=p3)};
    a084105(600000000) \\ Hugo Pfoertner, Sep 04 2020

Extensions

More terms from Don Reble, May 29 2003
a(32)-a(34) from Hugo Pfoertner, Nov 06 2019

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

Views

Author

Keywords

Examples

			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.
		

Crossrefs

Extensions

Corrected by R. J. Mathar, Sep 29 2006
Three more terms from Donovan Johnson, Jan 28 2008
Showing 1-8 of 8 results.