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.

A053709 Prime balanced factorials: numbers k such that k! is the mean of its 2 closest primes.

Original entry on oeis.org

3, 5, 10, 21, 171, 190, 348, 1638, 3329
Offset: 1

Views

Author

Labos Elemer, Feb 10 2000

Keywords

Comments

Also, the integers k such that A033932(k) = A033933(k).
k! is an interprime, i.e., the average of two successive primes.
The difference between k! and any of its two closest primes must be 1 or exceed k. - Franklin T. Adams-Watters
Larger terms may involve probable primes. - Hans Havermann, Aug 14 2014

Examples

			For the 1st term, 3! is in the middle between its closest prime neighbors 5 and 7.
For the 2nd term, 5! is in the middle between its closest prime neighbors 113 and 127.
From _Jon E. Schoenfield_, Jan 14 2022: (Start)
In the table below, k = a(n), k! - d and k! + d are the two closest primes to k!, and d = A033932(k) = A033933(k) = A053711(n):
.
  n     k     d
  -  ----  ----
  1     3     1
  2     5     7
  3    10    11
  4    21    31
  5   171   397
  6   190   409
  7   348  1657
  8  1638  2131
  9  3329  7607
(End)
		

Crossrefs

Cf. A075409 (smallest m such that n!-m and n!+m are both primes).

Programs

  • Maple
    for n from 3 to 200 do j := n!-prevprime(n!): if not isprime(n!+j) then next fi: i := 1: while not isprime(n!+i) and (i<=j) do i := i+2 od: if i=j then print(n):fi:od:
  • Mathematica
    PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k] Do[ a = n!; If[2a == PrevPrim[a] + NextPrim[a], Print[n]], {n, 3, 415}]

Extensions

a(5)-a(6) from Jud McCranie, Jul 04 2000
a(7) from Robert G. Wilson v, Sep 17 2002
a(8) from Donovan Johnson, Mar 23 2008
a(9) from Hans Havermann, Aug 14 2014

A053712 Lower balancing primes to prime-balanced factorials.

Original entry on oeis.org

5, 113, 3628789, 51090942171709439969
Offset: 1

Views

Author

Labos Elemer, Feb 10 2000

Keywords

Comments

The next two terms are 171!-397 and 190!-409. - Jud McCranie, Jul 04 2000

Examples

			113 is balancing 5! = 120 from below, where 5! = 120 is a balanced factorial.
		

Crossrefs

Formula

a(n) = A053709(n)! - A053711(n) = A053710(n) - A053711(n). - Amiram Eldar, Mar 10 2025

A053713 Upper balancing primes to prime-balanced factorials.

Original entry on oeis.org

7, 127, 3628811, 51090942171709440031
Offset: 1

Views

Author

Labos Elemer, Feb 10 2000

Keywords

Comments

The next two terms are 171!+397 and 190!+409, which are too large to include. - Jud McCranie, Jul 04 2000

Examples

			127 is balancing 5! = 120 from above, where 5! = 120 is a balanced factorial.
		

Crossrefs

Formula

a(n) = A053709(n)! + A053711(n) = A053710(n) + A053711(n). - Amiram Eldar, Mar 10 2025

A350782 a(n) is the number of pairs of primes (p,q), p < q, such that (p + q)/2 = n!.

Original entry on oeis.org

1, 5, 18, 60, 315, 1615, 9928, 70437, 637504, 5829386, 64647125, 722750400
Offset: 3

Views

Author

Jon E. Schoenfield, Jan 15 2022

Keywords

Comments

a(n) is the number of pairs of primes that are equidistant from n!.
Equivalently, a(n) is the number of positive integers d such that n! - d and n! + d are primes. For the smallest such d, iff there are no primes in the open interval (n! - d, n! + d), then n is a term in A053709, n! is a term in A053710, and d is a term in A053711.

Examples

			For n = 4, n! = 24, from which 5 pairs of primes are equidistant; in order of increasing distance, these are (19, 29), (17, 31), (11, 37), (7, 41), and (5, 43), so a(4) = 5. (A prime (23) lies between 19 and 29, so n=4 is not a term of A053709.)
For n = 5, n! = 120, from which 18 pairs of primes are equidistant: (113, 127), (109, 131), (103, 137), (101, 139), (89, 151), (83, 157), (73, 167), (67, 173), (61, 179), (59, 181), (47, 193), (43, 197), (41, 199), (29, 211), (17, 223), (13, 227), (11, 229), and (7, 233), so a(5) = 18. (The pair least distant from 120 is (113, 127), and there are no primes between 113 and 127, so n = 5 is a term of A053709, n! = 120 is a term of A053710, and d = 120 - 113 = 127 - 120 = 7 is a term of A053711.)
		

Crossrefs

Programs

  • Mathematica
    Table[Length@IntegerPartitions[2n!,2,Prime@Range@PrimePi[2n!]],{n,3,9}] (* Giorgos Kalogeropoulos, Jan 16 2022 *)
  • Python
    from sympy import isprime, nextprime, factorial
    def A350782(n):
        m, p, c = factorial(n), 3, 0
        while p <= m:
            if isprime(2*m-p):
                c += 1
            p = nextprime(p)
        return c # Chai Wah Wu, Jan 16 2022

Formula

a(n) = A002375(n!).

Extensions

a(14) from Martin Ehrenstein, Jan 25 2022
Showing 1-4 of 4 results.