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-10 of 20 results. Next

A339274 Number of times the n-th prime (=A000040(n)) occurs in A033933.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 0, 0, 1, 0, 4, 1, 1, 1, 1, 2, 3, 2, 1, 2, 3, 2, 2, 2, 3, 3, 4, 0, 4, 2, 4, 2, 1, 1, 1, 1, 2, 2, 2, 1, 1, 0, 3, 3, 3, 2, 2, 1, 0, 4, 1, 2, 0, 2, 1, 3, 2, 4, 2, 2, 3, 4, 0, 4, 1, 3, 2, 2, 4, 0, 5, 2, 6, 2, 3, 3, 0, 5, 2, 4, 2, 3, 3, 1, 3, 2
Offset: 1

Views

Author

A.H.M. Smeets, Dec 25 2020

Keywords

Comments

Each term in A033933 is either 1 or a prime number. Moreover it is known that each prime occurs only a finite number of times in A033933.
By excluding the terms that equal one from A033933, we observe the smallest value of A033933(n)/log(n!) in the range n = 3..2000 to be ~0.1552. From this it is believed that the primes less than 0.9*log(2001!)*0.1552 (~ 1846) will not occur anymore in the sequence A033933 for n > 2000; the applied factor 0.9 is a safety factor to be more or less sure that the prime numbers up to about 1846 will no longer occur in A033933.

Examples

			The prime number 13 occurs 2 times in A033933, and A000040(6) = 13, so a(6) = 2.
		

Crossrefs

See also A340006, A340007 (p#).

Formula

It seems that Sum_{k = 1..n} a(k) ~ 0.7*A000040(n)/log(log(A000040(n))).

A033932 Least positive m such that n! + m is prime.

Original entry on oeis.org

1, 1, 1, 1, 5, 7, 7, 11, 23, 17, 11, 1, 29, 67, 19, 43, 23, 31, 37, 89, 29, 31, 31, 97, 131, 41, 59, 1, 67, 223, 107, 127, 79, 37, 97, 61, 131, 1, 43, 97, 53, 1, 97, 71, 47, 239, 101, 233, 53, 83, 61, 271, 53, 71, 223, 71, 149, 107, 283, 293, 271, 769, 131, 271
Offset: 0

Views

Author

Keywords

Comments

Conjecture: No term is a composite number. a(n) is a prime > 3*prime(k), where k is such that prime(k) < n <= prime(k+1). - Amarnath Murthy, Apr 07 2004
Terms after n = 2000 in the b-file correspond to Fermat and Lucas PRP. - Phillip Poplin, Oct 12 2019

Crossrefs

Programs

  • Maple
    a:= n-> (f-> nextprime(f)-f)(n!):
    seq(a(n), n=0..70);  # Alois P. Heinz, Feb 22 2023
  • Mathematica
    a[n_] := (an = 1; While[ !PrimeQ[n! + an], an++]; an); Table[a[n], {n, 0, 63}] (* Jean-François Alcover, Dec 05 2012 *)
    NextPrime[#]-#&/@(Range[0,70]!) (* Harvey P. Dale, May 18 2014 *)
  • PARI
    for(n=0,70, k=1; while(!isprime(n!+k), k++); print1(k,","))
    
  • PARI
    a(n) = nextprime(n!+1) - n!; \\ Michel Marcus, Dec 25 2020
    
  • Python
    from sympy import factorial, nextprime
    def a(n): fn = factorial(n); return nextprime(fn) - fn
    print([a(n) for n in range(64)]) # Michael S. Branicky, May 22 2022

Formula

a(n) = A151800(n!) - n!. - Max Alekseyev, Jul 23 2014

Extensions

More terms from Jud McCranie
a(21) onwards from Wouter Meeussen
Better description from Rick L. Shepherd, Nov 06 2002

A006990 Largest prime <= n!.

Original entry on oeis.org

2, 5, 23, 113, 719, 5039, 40289, 362867, 3628789, 39916787, 479001599, 6227020777, 87178291199, 1307674367953, 20922789887947, 355687428095941, 6402373705727959, 121645100408831899, 2432902008176639969, 51090942171709439969, 1124000727777607679927
Offset: 2

Views

Author

Keywords

Comments

Conjecture: For n >= 2, n! - a(n) is 1 or a prime, see A033933. - Amarnath Murthy, Mar 19 2002
a(n) is the largest prime divisor of (n!)! of the sequence A000197. - Stanislav Sykora, Jul 14 2014

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    PrevPrime[ n_Integer ] := Module[ {k = n - 1}, While[ ! PrimeQ[ k ], k-- ]; k ]; Table[ PrevPrime[ n! ], {n, 3, 25} ]
    Join[{2},NextPrime[Range[3,30]!,-1]] (* Harvey P. Dale, Jan 24 2014 *)

Extensions

More terms from Jud McCranie; also from Robert G. Wilson v, Jan 03 2001

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

A074967 a(n) = least k such that n^n - k is prime.

Original entry on oeis.org

1, 4, 5, 4, 7, 2, 3, 10, 33, 42, 19, 12, 17, 52, 59, 18, 65, 2, 51, 2, 23, 120, 35, 2, 63, 10, 39, 186, 7, 74, 47, 200, 53, 24, 19, 48, 333, 56, 57, 192, 127, 348, 63, 124, 213, 60, 359, 2, 213, 2, 387, 526, 269, 252, 863, 16, 131, 370, 503, 294, 83, 68, 317
Offset: 2

Views

Author

Zak Seidov, Oct 03 2002

Keywords

Crossrefs

Programs

  • Mathematica
    PrimePrevDelta[n_]:=Module[{k},k=n-1;While[ !PrimeQ[k],k-- ];k=n-k]; lst={};Do[AppendTo[lst,PrimePrevDelta[n^n]],{n,2,5!}];lst (* Vladimir Joseph Stephan Orlovsky, Jun 11 2009 *)
    lk[n_]:=Module[{nn=n^n},nn-NextPrime[nn,-1]]; Array[lk,70,2] (* Harvey P. Dale, Jan 20 2019 *)
  • PARI
    a(n)=(x->x-precprime(x))(n^n) \\ Charles R Greathouse IV, Nov 25 2014

Extensions

More terms from Robert G. Wilson v, Oct 04 2002
Offset corrected by R. J. Mathar, Jun 12 2009

A053710 Prime-balanced factorials: factorials k! that are the mean of their 2 closest neighboring primes.

Original entry on oeis.org

6, 120, 3628800, 51090942171709440000
Offset: 1

Views

Author

Labos Elemer, Feb 10 2000

Keywords

Comments

Values of k are in A053709.
The next two terms are 171! and 190!. - Jud McCranie, Jul 04 2000

Examples

			For k = 21, k! = 51090942171709440000, d = 31, and the closest primes to 21! are q = 21! - 31 = 51090942171709439969, p = 21! + 31 = 51090942171709440031.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[25]!,NextPrime[#]-#==#-NextPrime[#,-1]&] (* Harvey P. Dale, May 08 2025 *)

Formula

k! = (p+q)/2; p = k! + d, q = k! - d, where p and q are the closest primes to k!.
a(n) = A053709(n)!.

Extensions

a(3) corrected by Sean A. Irvine, Jan 14 2022

A056752 Distance from n! to the nearest prime.

Original entry on oeis.org

1, 0, 1, 1, 7, 1, 1, 23, 13, 11, 1, 1, 23, 1, 43, 23, 31, 37, 89, 29, 31, 31, 89, 73, 41, 37, 1, 67, 31, 1, 61, 1, 1, 97, 61, 127, 1, 1, 73, 53, 1, 79, 71, 47, 53, 89, 79, 53, 59, 61, 179, 53, 59, 127, 61, 149, 107, 109, 137, 139, 71, 71, 101, 67, 127, 283, 73, 83, 103, 97
Offset: 1

Views

Author

Labos Elemer, Jan 19 2001

Keywords

Examples

			For both 1! and 2! the nearest prime neighbor is 2, with distances of 1 and 0, respectively. The nearest primes around 8! are 40289 and 40343 with distances of 31 and 23, so a(8)=23.
		

Crossrefs

Cf. A006990, A037151, A033932, A033933, A053714 (signed version with a different second term).

Programs

  • Maple
    with(numtheory): [seq(min(nextprime(i!)-i!,i!-prevprime(i!)),i=3..100)]; # a(1) and a(2) computed individually
  • Mathematica
    Table[Function[k, Min[k - #, NextPrime@ # - k] &@If[n == 1, 0, Prime@ PrimePi@ k]][n!], {n, 16}] (* Michael De Vlieger, Jul 15 2017 *)

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

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

Original entry on oeis.org

0, 1, 5, 7, 19, 19, 31, 17, 11, 17, 83, 67, 353, 227, 163, 59, 61, 113, 353, 31, 1447, 571, 389, 191, 337, 883, 101, 1823, 659, 709, 163, 1361, 439, 307, 1093, 1733, 2491, 1063, 1091, 1999, 1439, 109, 2753, 607, 2617, 269, 103, 2663, 337, 14447, 2221, 5471, 2887
Offset: 2

Views

Author

Zak Seidov, Sep 18 2002

Keywords

Comments

For n=3,5,10,21,171,190,348, n! is an interprime, the average of two consecutive primes, see A053709. In general n! may be average of several pairs of primes, in which case the minimal distance is in the sequence. See also n^n and n!! as average of two primes in A075468 and A075410.
According to Goldbach's conjecture, a(n) always exists with a(n) = A047160(n!). - Jens Kruse Andersen, Jul 30 2014

Examples

			a(4)=5 because 4!=24 and 19 and 25 are primes with smallest distance 5 from 4!.
		

Crossrefs

Programs

  • Mathematica
    smp[n_]:=Module[{m=1,nf=n!},While[!PrimeQ[nf+m]||!PrimeQ[nf-m],m=m+2];m]; Join[{0},Array[smp,60,3]] (* Harvey P. Dale, Apr 18 2014 *)
  • PARI
    a(n) = {my (m=0); until (ok, ok = isprime(n!-m) && isprime(n!+m); if (!ok, m++);); return (m);} \\ Michel Marcus, Apr 19 2013

Extensions

More terms from David Wasserman, Jan 17 2005

A053711 Numbers d such that, for some k, the upper and lower primes closest to k! are k! + d and k! - d.

Original entry on oeis.org

1, 7, 11, 31, 397, 409, 1657, 2131, 7607
Offset: 1

Views

Author

Labos Elemer, Feb 10 2000

Keywords

Comments

This sequence lists d = nextprime(k!) - k! = prevprime(k!) - k! for k in A053709.

Examples

			For k = 10, k! = 3628800, d = 11, and the closest primes to 10! are q = 10! - 11 = 3628789 and p = 10! + 11 = 3628811. The differences d are listed here.
		

Crossrefs

Programs

  • Mathematica
    Reap[Do[If[SameQ @@ #, Sow@ First[#]] &@ Abs[# - NextPrime[#, {-1, 1}]] &[i!], {i, 200}]][[-1, -1]] (* Michael De Vlieger, Jan 14 2022 *)

Extensions

a(5)-a(8) from Donovan Johnson, Oct 12 2008
a(9) from Hans Havermann, Aug 15 2014
Showing 1-10 of 20 results. Next