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

A075468 Minimal m such that n^n-m and n^n+m are both primes, or -1 if there is no such m.

Original entry on oeis.org

1, 4, 15, 42, 7, 186, 75, 10, 33, 1302, 487, 114, 297, 58, 2253, 1980, 1045, 1638, 1767, 2032, 8067, 10800, 257, 588, 3423, 3334, 5907, 12882, 1213, 12972, 8547, 3644, 7035, 2178, 16747, 24324, 5523, 12628, 2241, 25602, 16495, 41706, 23127, 22376, 24927
Offset: 2

Views

Author

Zak Seidov, Sep 18 2002

Keywords

Comments

n^n is an interprime, the average of two consecutive primes, presumably only for n = 2, 6 and 9. In general n^n may be average of several pairs of primes, in which case the minimal distance is in the sequence. It is not clear (but quite probable) that for all n, n^n is the average of two primes. See also n! and n!! as average of two primes in A075409 and A075410.
n^n -/+ a(n) are both primes, with a(n) being the smallest common distance.

Examples

			a(4)=15 because 4^4=256 and 256 -/+ 15 = 271 and 241 are primes with smallest distance from 4^4; a(23)= 10800 because 23^23 = 20880467999847912034355032910567 and 23^23 -/+ 10800 are two primes with the smallest distance from 23^23.
		

Crossrefs

Programs

  • Mathematica
    fm[n_]:=Module[{n2=n^n,m=1},While[!PrimeQ[n2+m]||!PrimeQ[n2-m],m++];m]; Array[fm,50,2] (* Harvey P. Dale, May 19 2012 *)
  • PARI
    a(n) = my(m=1,nn=n^n); while (! (ispseudoprime(nn-m) && ispseudoprime(nn+m)), m++); m; \\ Michel Marcus, Feb 21 2025

Formula

a(n) = A082467(A000312(n)). - Michel Marcus, Feb 21 2025

Extensions

More terms from Lior Manor, Sep 18 2002
Corrected by Harvey P. Dale, May 19 2012

A245697 Least number k such that (n!+k)/n and (n!-k)/n are both prime.

Original entry on oeis.org

0, 4, 25, 42, 133, 152, 279, 170, 121, 204, 1079, 938, 5295, 3632, 2771, 1062, 1159, 2260, 7413, 682, 33281, 13704, 9725, 4966, 9099, 24724, 2929, 54690, 20429, 22688, 5379, 46274, 15365, 11052, 40441, 65854, 97149, 42520, 44731, 83958, 61877, 4796, 123885, 27922, 122999, 12912, 5047
Offset: 3

Views

Author

Derek Orr, Jul 29 2014

Keywords

Comments

a(n) < n! for all n > 2.
It is believed that a(n) exists for all n > 2.
a(n) = n times (least m such that (n-1)!+m and (n-1)!-m are both prime) = n*A075409(n-1). - Jens Kruse Andersen, Jul 30 2014 [Goldbach's conjecture would then imply that a(n) always exists.]

Examples

			(4!+4)/4 = 7 is prime and (4!-4)/4 = 5 is prime. Thus a(4) = 4.
		

Crossrefs

Programs

  • PARI
    a(n)=for(k=0,10^7,s1=(n!-k)/n;s2=(n!+k)/n;if(floor(s1)==s1&&floor(s2)==s2,if(ispseudoprime(s1)&&ispseudoprime(s2),return(k))))
    n=3;while(n<100,print1(a(n),", ");n++)

A075410 a(n) is the smallest m such that n!!-m and n!!+m are both primes.

Original entry on oeis.org

0, 0, 3, 2, 5, 2, 5, 8, 7, 4, 19, 16, 29, 68, 97, 16, 109, 86, 19, 158, 17, 172, 41, 16, 529, 106, 263, 212, 163, 302, 593, 302, 607, 262, 311, 428, 227, 106, 1271, 8, 229, 386, 1489, 32, 47, 1996, 1097, 2566, 41, 632, 1913, 458, 149, 1244, 2837, 362, 3317, 908
Offset: 2

Views

Author

Zak Seidov, Sep 18 2002

Keywords

Comments

For n = 5,7,10,11,22,41,67,76,91,96,163,245,299,341, n!! is an interprime, the average of two consecutive primes, see A075275. See also n^n and n! as average of two primes in A075468 and A075409.

Examples

			a(4) = 3 because 4!! = 8 and 8 -/+ 3 = 5 and 11 are primes with smallest equal distances from 4!!
		

Crossrefs

Programs

  • Mathematica
    smbp[n_]:=Module[{m=0,n2=n!!},While[Total[Boole[PrimeQ[n2+{m,-m}]]] != 2,m++];m]; Array[smbp,60,2] (* Harvey P. Dale, Sep 02 2017 *)

Extensions

More terms from David Wasserman, Jan 17 2005
Showing 1-4 of 4 results.