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.

Previous Showing 11-20 of 20 results.

A053714 Smallest (in magnitude) nonzero number m such that n!+m is prime.

Original entry on oeis.org

1, 1, 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, -751, 101
Offset: 1

Views

Author

Labos Elemer, Feb 10 2000

Keywords

Comments

a(n) is the defined, nonzero (thus excluding a(1) and a(2) of A033933) minimum of A033932(n) and A033933(n) multiplied by -1 if that minimum is not A033932(n). If n!+m and n!-m are equidistant primes (A053709), we have (arbitrarily) chosen positive m.

Examples

			For n=4, the possible m are -1 (24-1) and +5 (24+5). The former is closer to 4! so a(4) is -1.
For n=5, the possible m are -7 (120-7) and +7 (120+7). Being equidistant to 5!, a(5) is +7.
		

Crossrefs

Cf. A006990, A037151, A033932, A033933, A053709, A056752 (unsigned version with a different second term).

Extensions

Edited by Hans Havermann, Jul 23 2014

A339959 Number of times the n-th prime (=A000040(n)) occurs in A033932.

Original entry on oeis.org

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

Views

Author

A.H.M. Smeets, Dec 25 2020

Keywords

Comments

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

Examples

			The prime number 11 occurs 2 times in A033932, and A000040(5) = 11, so a(5) = 2.
		

Crossrefs

Formula

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

A245696 Least number k >= 0 such that (n!-k)/n is prime.

Original entry on oeis.org

0, 4, 5, 42, 7, 8, 279, 130, 121, 156, 13, 322, 15, 752, 901, 1062, 779, 2020, 651, 682, 1679, 2136, 1825, 3874, 999, 1204, 2929, 930, 31, 1952, 33, 34, 6755, 4068, 4699, 3686, 39, 2920, 3403, 5502, 3397, 4796, 4905, 2438, 4183, 3792, 5047, 2950, 4947, 9308, 3551, 3186, 6985, 3416, 26277, 16066, 6431, 8220, 8479, 4402, 4473, 6464, 23335, 8382, 21239, 12988, 17319, 7210, 6887, 54072, 11899, 27602
Offset: 3

Views

Author

Derek Orr, Jul 29 2014

Keywords

Comments

a(n) < n! for all n > 2.
a(n) = n times (least m >= 0 such that (n-1)!-m is prime) = n*A033933(n-1). - Jens Kruse Andersen, Jul 30 2014 (This shows that a(n) always exists.)

Examples

			(6!-42)/6 = 113 is prime. Since 42 is the smallest number to produce a prime, a(6) = 42.
		

Crossrefs

Programs

  • Mathematica
    lnk[n_]:=Module[{k=0},While[!PrimeQ[(n!-k)/n],k++];k]; Array[lnk,80,3] (* Harvey P. Dale, Jan 30 2023 *)
  • PARI
    a(n)=for(k=0,10^6,s=(n!-k)/n;if(floor(s)==s,if(ispseudoprime(s),return(k))))
    n=3;while(n<100,print1(a(n),", ");n++)

A297707 a(n) = Product_{k=1..n-1} n!k, where n!k is k-tuple factorial of n.

Original entry on oeis.org

1, 2, 18, 768, 90000, 44789760, 30494620800, 121762322841600, 393644011735296000, 5618427494400000000000, 107587910030480590233600000, 5951222311476064581656248320000, 176804782652901880753915871232000000, 69819090744423637487544223697731584000000
Offset: 1

Views

Author

Lechoslaw Ratajczak, Jan 03 2018

Keywords

Comments

What is the least n > 2 for which a(n) - prevprime(a(n)) is a composite number? If such a number n exists, it is greater than 250.
The least n for which nextprime(a(n)) - a(n) is a composite number is 158.

Examples

			a(2) = (2!1) = (2*1) = 2;
a(3) = (3!1)*(3!2) = (3*2*1)*(3*1) = 18;
a(4) = (4!1)*(4!2)*(4!3) = (4*3*2*1)*(4*2)*(4*1) = 768;
a(5) = (5!1)*(5!2)*(5!3)*(5!4) = (5*4*3*2*1)*(5*3*1)*(5*2)*(5*1) = 90000.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, k) option remember; `if`(n<1, 1, n*b(n-k, k)) end:
    a:= n-> mul(b(n, k), k=1..n-1):
    seq(a(n), n=1..20);  # Alois P. Heinz, Dec 02 2018
  • Mathematica
    Array[(#^(# - 1)) Product[k^DivisorSigma[0, # - k], {k, # - 1}] &, 13] (* Michael De Vlieger, Jan 04 2018 *)
  • PARI
    a(n) = (n^(n-1))*prod(k=1, n-1, k^numdiv(n-k)); \\ Michel Marcus, Dec 02 2018

Formula

a(n) = Product_{t=1..n-1} (Product_{k=0..floor((n-1)/t)} (n-t*k)).
a(n) = (n^(n-1))*Product_{k=1..n-1} k^tau(n-k).

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

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

A053708 Nearest prime to n! (but not equal to n!).

Original entry on oeis.org

2, 3, 5, 23, 113, 719, 5039, 40343, 362867, 3628789, 39916801, 479001599, 6227020777, 87178291199, 1307674368043, 20922789888023, 355687428096031, 6402373705728037, 121645100408832089, 2432902008176640029, 51090942171709439969, 1124000727777607680031, 25852016738884976639911
Offset: 1

Views

Author

Labos Elemer, Feb 10 2000

Keywords

Comments

If n! is the average of its closest prime neighbors then the smaller prime is to be chosen (as in A051701).

Examples

			For 8! = 40320 the closest upper and lower primes are 40289 and 40343 with d = 31 and d = 23, so 40343 is closer to 8! than the lower neighbor.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=Module[{nf=n!,s,l},s=NextPrime[nf,-1];l=NextPrime[nf];If[nf-s>l-nf,l,s]]
    Table[f[i],{i,25}] (* Harvey P. Dale, Dec 08 2010 *)

Extensions

Corrected by Rick L. Shepherd, Jan 11 2006
a(21)-a(23) from Amiram Eldar, Mar 10 2025

A108519 a(n) is the smallest natural number m such that (10^n)! - m is prime.

Original entry on oeis.org

11, 271, 6701, 40471
Offset: 1

Views

Author

Farideh Firoozbakht, Jul 10 2005

Keywords

Comments

If a(n) is composite then a(n)>10^(2n)+2*10^n. Conjecture: All terms are noncomposite numbers.
(10^4)!-40471 is a probable prime. - Jason Yuen, May 20 2024

Examples

			a(3)=6701 because (10^3)!-6701 is prime and for 0<m<6701 1000!-m is
composite.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := (For[m = 1, ! PrimeQ[(10^n)! - m], m++ ]; m); Do[Print[a[n]], {n, 3}]

Formula

a(n) = A033933(10^n). - Jason Yuen, May 20 2024

Extensions

a(4) from Jason Yuen, May 20 2024

A131057 Least nonnegative k such that n!-k is semiprime.

Original entry on oeis.org

0, 2, 1, 2, 7, 1, 2, 1, 5, 3, 1, 19, 11, 1, 19, 19, 11, 1, 19, 23, 1, 1, 47, 1, 1, 29, 3, 29, 2, 59, 73, 1, 43, 1, 13, 17, 41, 1, 2, 5, 3, 53, 79, 7, 1, 53, 23, 1, 13, 13, 61, 7, 59, 61, 7, 31, 1, 89, 107, 103, 67, 47, 103, 19, 43, 1, 71, 11, 7, 83, 79, 67, 71
Offset: 3

Views

Author

Jonathan Vos Post, Sep 24 2007

Keywords

Comments

Semiprime analog of A033933. After n = 3, a(n) is never again 0.

Examples

			a(3) = 0 because 3! - 0 = 6 - 0 = 6 = 2 * 3.
a(4) = 2 because 4! - 2 = 24 - 2 = 22 = 2 * 11.
a(5) = 1 because 5! - 1 = 119 = 7 * 17.
		

Crossrefs

Formula

a(n) = Min_{k such that n!-k is in A001358 and k>=0}.

Extensions

More terms from Jinyuan Wang, Aug 28 2022
Previous Showing 11-20 of 20 results.