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.

A058054 Smallest prime > n! minus largest prime <= n!.

Original entry on oeis.org

1, 2, 6, 14, 8, 12, 54, 30, 22, 14, 30, 90, 20, 90, 76, 90, 78, 190, 60, 62, 104, 186, 204, 190, 96, 44, 168, 254, 108, 188, 80, 38, 290, 174, 258, 98, 44, 170, 136, 132, 176, 180, 156, 292, 190, 312, 156, 142, 158, 450, 120, 130, 350, 132, 610, 384, 392, 430
Offset: 2

Views

Author

Labos Elemer, Nov 20 2000

Keywords

Examples

			For n = 2, 3, 4, 5, A037151(n) = 3, 7, 29, 127 and A006990(n) = 2, 5, 23, 113. The differences are: 1, 2, 6, 14.
		

Crossrefs

Essentially the same as A054588.

Programs

  • Maple
    [seq(nextprime(i!)-prevprime(i!+1), i=2...100)];
  • Mathematica
    f[n_] := NextPrime[n!] - NextPrime[n!, -1]; Array[f, 70, 3] (* Robert G. Wilson v, Jul 23 2014 *)

Formula

a(n) = A037151(n) - A006990(n)
a(n) = A033932(n) + A033933(n)

Extensions

Edited by Hans Havermann, Jul 23 2014

A340013 The prime gap, divided by two, which surrounds n!.

Original entry on oeis.org

1, 3, 7, 4, 6, 27, 15, 11, 7, 15, 45, 10, 45, 38, 45, 39, 95, 30, 31, 52, 93, 102, 95, 48, 22, 84, 127, 54, 94, 40, 19, 145, 87, 129, 49, 22, 85, 68, 66, 88, 90, 78, 146, 95, 156, 78, 71, 79, 225, 60, 65, 175, 66, 305, 192, 196, 215, 205, 420, 101, 186, 213, 160
Offset: 3

Views

Author

Robert G. Wilson v, Jan 09 2021

Keywords

Comments

A theorem states that between (n+1)! + 2 and (n+1)! + (n+1) inclusive, there are n consecutive composite integers, namely 2, 3, 4, ..., n, n+1.
Records: 1, 3, 7, 27, 45, 95, 102, 127, 145, 146, 156, 225, 305, 420, 804, 844, 1173, 1671, 1725, 1827, 2570, 2930, 3318, 5142, 5946, 6837, 7007, 8208, 10221, ..., .

Examples

			For a(1), there are no positive primes which surround 1!. Therefore a(1) is undefined.
For a(2), 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(2) is undefined.
For a(3), the following set of numbers, {5, 6, 7}, with 3! being in the middle. The prime gap is 2; therefore, a(3) = 1.
For a(4), the following set of numbers, {23, 24, 25, 26, 27, 28, 29} with 4! in between the two primes 23 & 29. The prime gap is 6, so a(4) = 3.
		

Crossrefs

Programs

  • Maple
    a:= n-> (f-> (nextprime(f-1)-prevprime(f+1))/2)(n!):
    seq(a(n), n=3..70);  # Alois P. Heinz, Jan 09 2021
  • Mathematica
    a[n_] := (NextPrime[n!, 1] - NextPrime[n!, -1])/2; Array[a, 70, 3]
  • PARI
    a(n) = (nextprime(n!+1) - precprime(n!-1))/2; \\ Michel Marcus, Jan 11 2021
    
  • Python
    from sympy import factorial, nextprime, prevprime
    def A340013(n):
        f = factorial(n)
        return (nextprime(f)-prevprime(f))//2 # Chai Wah Wu, Jan 23 2021

Formula

a(n) = (A037151(n) - A006990(n))/2 = (A033932(n) + A033933(n))/2.
a(n) = A054588(n)/2 = A058054(n)/2. - Alois P. Heinz, Jan 09 2021

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.

A379449 Numbers k such that the prime gap between the consecutive primes p1 < k! = factorial(k) < p2 sets a new record.

Original entry on oeis.org

3, 4, 5, 8, 13, 19, 24, 29, 34, 45, 47, 51, 56, 61, 71, 107, 127, 140, 184, 192, 198, 274, 284, 375, 384, 559, 592, 630, 689, 774, 792, 834, 1133, 1213, 1241, 1315, 1947
Offset: 1

Views

Author

Jean-Marc Rebert, Dec 23 2024

Keywords

Examples

			a(1) = 3, because the prime gap between the consecutive primes 5 < 3! < 7 sets the first record of 2.
 n gap            p1            <  x! <             p2
 1   2                        5 <  3! <                        7;
 2   6                       23 <  4! <                       29;
 3  14                      113 <  5! <                      127;
 4  54                    40289 <  8! <                    40343;
 5  90               6227020777 < 13! <               6227020867;
 6 190       121645100408831899 < 19! <       121645100408832089;
 7 204 620448401733239439359927 < 24! < 620448401733239439360131;
		

Crossrefs

Extensions

a(37) from Jinyuan Wang, Dec 23 2024
Showing 1-4 of 4 results.