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-4 of 4 results.

A327441 a(n) = max_{p <= n} (p'-p), where p and p' are successive primes.

Original entry on oeis.org

1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 14, 14, 14, 14, 14, 14, 14
Offset: 2

Views

Author

N. J. A. Sloane, Sep 11 2019

Keywords

Comments

This is Maier and Pomerance's G(n).

Examples

			a(2) = 1 from p=2, p'=3.
a(3) = 2 from p=3, p'=5.
		

References

  • Erdos, Paul. "On the difference of consecutive primes." The Quarterly Journal of Mathematics 1 (1935): 124-128.
  • Erdös, P. "On the difference of consecutive primes." Bulletin of the American Mathematical Society 54.10 (1948): 885-889.
  • Maier, Helmut, and Carl Pomerance. "Unusually large gaps between consecutive primes." Transactions of the American Mathematical Society 322.1 (1990): 201-237.
  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, 1996, Section VII.22, p. 249. (See G(x). Gives bounds.)
  • Rankin, Robert Alexander. "The difference between consecutive prime numbers V." Proceedings of the Edinburgh Mathematical Society 13.4 (1963): 331-332.

Crossrefs

Cf. A063095.
A166594 is a similar sequence, but the present sequence matches the definition used by Maier and Pomerance.

Programs

  • Maple
    with(numtheory);
    M:=120; a:=[]; r:=0;
    for x from 2 to M do
      i1:=pi(x); p:=ithprime(i1); q:=ithprime(i1+1); d:=q-p;
        if d>r then r:=d; fi;
    a:=[op(a),r]; od: a; # N. J. A. Sloane, Sep 11 2019

A166594 Maximal prime gap q-p encountered from 0 to least prime > n.

Original entry on oeis.org

2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
Offset: 0

Views

Author

Daniel Forgues, Oct 17 2009

Keywords

Examples

			a(0) = 2 since the least prime greater than 0 is 2 (first occurrence of gap 2).
a(7) = 4 since the least prime greater than 7 is 11 (first occurrence of gap 4).
		

References

  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, 1996, Section VII.22, p. 249.

Crossrefs

A063096 Non-record differences among consecutive primes.

Original entry on oeis.org

10, 12, 16, 24, 26, 28, 30, 32, 38, 40, 42, 46, 48, 50, 54, 56, 58, 60, 62, 64, 66, 68, 70, 74, 76, 78, 80, 82, 84, 88, 90, 92, 94, 98, 100, 102, 104, 106, 108, 110, 116, 120, 122, 124, 126, 128, 130, 134, 136, 138, 140, 142, 144, 146, 150, 152, 156, 158, 160, 162
Offset: 1

Views

Author

Labos Elemer, Aug 07 2001

Keywords

Comments

These values do not arise in A005250 nor in A063095.
Almost certainly this sequence is exactly the even numbers not in A005250. - Franklin T. Adams-Watters, Oct 09 2006

Examples

			10 and 12 are here because after the first gap of 8 (89 to 97), the next larger gap is 14 (113 to 127); thus 10 and 12 are never the largest gap. 11 is not here because it is never the gap between consecutive primes.
		

Crossrefs

Programs

  • PARI
    { default(primelimit, 4294965247); n=0; r=0; for (m=1, 10^9, g=prime(m + 1) - prime(m); if (g > r, a=r + 2; r=g; while (a < r, write("b063096.txt", n++, " ", a); a+=2); if (n==100, break)) ) } \\ Harry J. Smith, Aug 18 2009

A345161 If n = Product (p_j^k_j) then a(n) = max (nextprime(p_j) - p_j), where nextprime = A151800.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 4, 1, 2, 2, 2, 2, 4, 4, 2, 1, 2, 2, 4, 2, 4, 2, 6, 2, 2, 4, 2, 4, 2, 2, 6, 1, 2, 2, 4, 2, 4, 4, 4, 2, 2, 4, 4, 2, 2, 6, 6, 2, 4, 2, 2, 4, 6, 2, 2, 4, 4, 2, 2, 2, 6, 6, 4, 1, 4, 2, 4, 2, 6, 4, 2, 2, 6, 4, 2, 4, 4, 4, 4, 2, 2, 2, 6, 4, 2, 4, 2, 2, 8, 2
Offset: 1

Views

Author

Ilya Gutkovskiy, Aug 26 2021

Keywords

Examples

			a(39) = a(3 * 13) = a(prime(2) * prime(6)), prime(3) - prime(2) = 5 - 3 = 2, prime(7) - prime(6) = 17 - 13 = 4, so a(39) = max(2, 4) = 4.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Max @@ (NextPrime[#[[1]]] - #[[1]] & /@ FactorInteger[n]); Table[a[n], {n, 1, 90}]

Formula

If n = Product (p_j^k_j) then a(n) = max (prime(pi(p_j) + 1) - p_j), where pi = A000720.
a(2^j*n) = a(n).
a(n^j) = a(n), j > 0.
a(prime(n)^j) = A001223(n), j > 0.
a(n!) = A327441(n).
a(prime(n)#) = A063095(n).
2 + Sum_{k=1..n-1} a(prime(k)^j) = prime(n), j > 0.
Sum_{d|n} mu(n/d) * a(d) = 0 if n is an even number or an odd number divisible by a square > 1.
Showing 1-4 of 4 results.