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-3 of 3 results.

A088332 Primes of the form k! + 1.

Original entry on oeis.org

2, 3, 7, 39916801, 10888869450418352160768000001, 13763753091226345046315979581580902400000001, 33452526613163807108170062053440751665152000000001
Offset: 1

Views

Author

Cino Hilliard, Nov 06 2003

Keywords

Comments

The next term is too large to include.
Of course 2 = 0! + 1 = 1! + 1 has two such representations.
Prime numbers that are the sum of two factorial numbers. - Juri-Stepan Gerasimov, Nov 08 2010

Examples

			3! + 1 = 7 is prime.
		

References

  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 118.

Crossrefs

Cf. A002981 (values of k), A038507, A062701.

Programs

  • Mathematica
    lst={};Do[p=n!+1;If[PrimeQ[p],AppendTo[lst,p]],{n,0,3*5!}];lst (* Vladimir Joseph Stephan Orlovsky, Jan 27 2009 *)
    Select[Range[50]!+1,PrimeQ] (* Harvey P. Dale, May 17 2025 *)
  • PARI
    factp1prime(n)=for(x=1,n,xf=x!+1; if(isprime(xf),print1(xf",")))

Formula

a(n) = A038507(A002981(n+1)). - Elmo R. Oliveira, Apr 16 2025

A136437 a(n) = prime(n) - k! where k is the greatest number such that k! <= prime(n).

Original entry on oeis.org

0, 1, 3, 1, 5, 7, 11, 13, 17, 5, 7, 13, 17, 19, 23, 29, 35, 37, 43, 47, 49, 55, 59, 65, 73, 77, 79, 83, 85, 89, 7, 11, 17, 19, 29, 31, 37, 43, 47, 53, 59, 61, 71, 73, 77, 79, 91, 103, 107, 109, 113, 119, 121, 131, 137, 143, 149, 151, 157, 161, 163, 173, 187, 191, 193, 197, 211, 217, 227, 229, 233, 239, 247
Offset: 1

Views

Author

Ctibor O. Zizka, Apr 02 2008

Keywords

Comments

How many times does each prime appear in this sequence?
The only value (prime(n) - k!) = 0 is at n=1, where k=2.
Are n=2, k=2 and n=4, k=3 the only occurrences of (prime(n) - k!) = 1?
There exist infinitely many solutions of the form (prime(n) - k!) = prime(n-t), t < n.
Are there infinitely many solutions of the form (prime(n) - k!) = prime(r_1)*...*prime(r_i); r_i < n for all i?
From Bernard Schott, Jul 16 2021: (Start)
Answer to the second question is no: 18 other occurrences (n,k) of (prime(n) - k!) = 1 are known today; indeed, every k > 1 in A002981 that satisfies k! + 1 is prime gives an occurrence, but only a third pair (n, k) is known exactly; and this comes for n = 2428957, k = 11 because (prime(2428957) - 11!) = 1.
The next occurrence corresponds to k = 27 and n = X where prime(X) = 1+27! = 10888869450418352160768000001 but index X is not yet available (see A062701).
For the occurrences of (prime(m) - k!) = 1, integers k are in A002981 \ {0, 1}, corresponding indices m are in A062701 \ {1} (only 3 indices are known today) and prime(m) are in A088332 \ {2}. (End)

Examples

			a(1)  = prime(1)  - 2! =  2 -  2 =  0;
a(2)  = prime(2)  - 2! =  3 -  2 =  1;
a(3)  = prime(3)  - 2! =  5 -  2 =  3;
a(4)  = prime(4)  - 3! =  7 -  6 =  1;
a(5)  = prime(5)  - 3! = 11 -  6 =  5;
a(6)  = prime(6)  - 3! = 13 -  6 =  7;
a(7)  = prime(7)  - 3! = 17 -  6 = 11;
a(8)  = prime(8)  - 3! = 19 -  6 = 13;
a(9)  = prime(9)  - 3! = 23 -  6 = 17;
a(10) = prime(10) - 4! = 29 - 24 =  5.
		

Crossrefs

Programs

  • Maple
    f:=proc(n) local p,i; p:=ithprime(n); for i from 0 to p do if i! > p then break; fi; od; p-(i-1)!; end;
    [seq(f(n),n=1..70)]; # N. J. A. Sloane, May 22 2012
  • Mathematica
    a[n_] := Module[{p, k},p = Prime[n];k = 1;While[Factorial[k] <= p, k++];p - Factorial[k - 1]] (* James C. McMahon, May 05 2025 *)
  • PARI
    a(n) = my(k=1, p=prime(n)); while (k! <= p, k++); p - (k-1)!; \\ Michel Marcus, Feb 19 2019

Formula

a(n) = prime(n)- k! where k is the greatest number for which k! <= prime(n).
a(n) = A212598(prime(n)). - Michel Marcus, Feb 19 2019
a(n) = A000040(n) - A346425(n). - Bernard Schott, Jul 16 2021

Extensions

More terms from Jinyuan Wang, Feb 18 2019

A100013 Number of prime factors in n!+7 (counted with multiplicity).

Original entry on oeis.org

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

Views

Author

Jonathan Vos Post, Nov 18 2004

Keywords

Examples

			Example 1!+7 = 2^3 so a(1) = 3.
a(3) = a(4) = a(5) = a(6) = 1 because 3!+1 = 13, 4!+7 = 31, 5!+1 = 127, 6!+7 = 727 and these are all primes. a(11) = a(15) = a(16) = a(25) = a(35) = a(59) = 2 because 11!+7 = 39916807 = 7 * 5702401, 15!+7 = 1307674368007 = 7 * 186810624001, 16!+7 = 20922789888007 = 7 * 2988969984001, 25!+7 = 15511210043330985984000007 = 7 * 2215887149047283712000001, 35!+7 = 10333147966386144929666651337523200000007 = 7 *
1476163995198020704238093048217600000001 and 59!+7 = 138683118545689835737939019720389406345902876772687432540821294940160000000000007 = 7 * 19811874077955690819705574245769915192271839538955347505831613562880000000000001 are all semiprimes.
		

References

  • C. Caldwell and H. Dubner, "Primorial, factorial and multifactorial primes," Math. Spectrum, 26:1 (1993/4) 1-7.

Crossrefs

Extensions

More terms from Sean A. Irvine, Sep 20 2012
Showing 1-3 of 3 results.