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

A340802 Number of composite numbers between the largest noncomposite number <= n! and the smallest noncomposite number >= n!.

Original entry on oeis.org

0, 0, 1, 5, 13, 7, 11, 53, 29, 21, 13, 29, 89, 19, 89, 75, 89, 77, 189, 59, 61, 103, 185, 203, 189, 95, 43, 167, 253, 107, 187, 79, 37, 289, 173, 257, 97, 43, 169, 135, 131, 175, 179, 155, 291, 189, 311, 155, 141, 157, 449, 119, 129, 349, 131, 609, 383, 391, 429
Offset: 1

Views

Author

Alois P. Heinz, Jan 21 2021

Keywords

Examples

			a(4) = 5: 24, 25, 26, 27, 28.
a(5) = 13: 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126.
a(6) = 7: 720, 721, 722, 723, 724, 725, 726.
		

Crossrefs

Programs

  • Maple
    prevprime(2):= 1:
    a:= n-> (f-> max(nextprime(f-1)-prevprime(f+1)-1, 0))(n!):
    seq(a(n), n=1..64);
  • Mathematica
    a[n_] := If[n<3, 0, NextPrime[n!] - NextPrime[n!, -1] - 1];
    Array[a, 100] (* Jean-François Alcover, Jan 29 2021 *)

Formula

a(n) = A058054(n)-1 for n >= 2.
a(n) = A054588(n)-1 for n >= 3.
a(n) = 2 * A340013 - 1 for n >= 3.

A340041 The prime gap, divided by two, which surrounds p#.

Original entry on oeis.org

1, 1, 6, 1, 9, 24, 23, 40, 51, 37, 60, 36, 68, 87, 66, 84, 99, 95, 115, 88, 117, 143, 51, 177, 182, 168, 139, 243, 221, 193, 204, 516, 260, 154, 182, 306, 239, 216, 191, 211, 303, 263, 672, 303, 615, 417, 312, 378, 275, 375, 322, 445, 312, 294, 354, 492, 399, 348, 461
Offset: 2

Views

Author

Robert G. Wilson v, Jan 22 2021

Keywords

Comments

If p and q are consecutive primes, we say here that there is a gap of q-p. (Other sequences use different definitions of "gap".) - N. J. A. Sloane, Mar 07 2021
Records: 1, 6, 9, 24, 40, 51, 60, 68, 87, 99, 115, 117, 143, 177, 182, 243, 516, 672, 855, 915, 925, 1100, 1139, 1620, 1863, 2272, 2842, 4177, 4190, 5025, 5692, 6254, 6413, 6879, 7914, 8026, 9928, 10604, ..., .

Examples

			For a(1), there are two contiguous primes {2, 3} with 2 being 2#. The prime gap is 1. However, the two primes do not surround 2#, so a(1) like A340013(2) is undefined.
For a(2), the prime gap contains {5, 6, 7}, with 3# = 6 in the middle. The prime gap is 2, therefore a(2) = 1;
For a(3), the prime gap contains {29, 30, 31}, with 5# = 30  in the middle. The prime gap is 2, therefore a(3) = 1.
For a(4), the prime gap contains {199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211}, with 7# =  205 in the middle. The prime gap is 12, therefore a(4) = 6. etc.
		

Crossrefs

Cf. A006862, A007014, A038711, A060270, A340013 (analog for n!).

Programs

  • Mathematica
    a[n_] := Block[{p = Times @@ Prime@ Range@ n}, (NextPrime[p, 1] - NextPrime[p, -1])/2]; a[1] = 0; Array[a, 60]

Formula

a(n) = (A006862(n) - A007014(n))/2 = (A038711(n) + A060270(n))/2.
a(n) = A058044(n)/2. - Hugo Pfoertner, Jan 22 2021
Showing 1-2 of 2 results.