OFFSET
0,1
COMMENTS
Theorem: For any N, there is a prime > N. Proof: Consider any prime factor of N! + 1.
Cf. Wilson's Theorem (1770): p | (p-1)! + 1 if and only if p is a prime.
If n is in A002981, then a(n) = n!+1. - Chai Wah Wu, Jul 15 2019
REFERENCES
Albert H. Beiler, "Recreations in The Theory of Numbers, The Queen of Mathematics Entertains," Dover Publ. NY, 1966, Page 49.
M. Kraitchik, On the divisibility of factorials, Scripta Math., 14 (1948), 24-26 (but beware errors).
LINKS
Chai Wah Wu, Table of n, a(n) for n = 0..138 n = 0..100 derived from Hisanori Mishima's data by T. D. Noe.
A. Borning, Some results for k!+-1 and 2.3.5...p+-1, Math. Comp., 26 (1972), 567-570.
P. Erdős and C. L. Stewart, On the greatest and least prime factors of n! + 1, J. London Math. Soc. (2) 13:3 (1976), pp. 513-519.
M. Kraitchik, On the divisibility of factorials, Scripta Math., 14 (1948), 24-26 (but beware errors). [Annotated scanned copy]
Hisanori Mishima, Factorizations of many number sequences
Hisanori Mishima, Factorizations of many number sequences
R. G. Wilson v, Explicit factorizations
FORMULA
Erdős & Stewart show that a(n) > n + (l-o(l))log n/log log n except when n + 1 is prime, and that a(n) > n + e(n)sqrt(n) for almost all n where e(n) is any function with lim e(n) = 0. - Charles R Greathouse IV, Dec 05 2012
By Wilson's theorem, a(n) >= n + 1 with equality if and only if n + 1 is prime. - Chai Wah Wu, Jul 14 2019
EXAMPLE
a(3) = 7 because 3! + 1 = 7.
a(4) = 5 because 4! + 1 = 25 = 5^2. (5! + 1 is also the square of a prime).
a(6) = 7 because 6! + 1 = 721 = 7 * 103.
MAPLE
with(numtheory): A051301 := n -> sort(convert(divisors(n!+1), list))[2]; # Corrected by Peter Luschny, Jul 17 2009
MATHEMATICA
Do[ Print[ FactorInteger[ n! + 1, FactorComplete -> True ] [ [ 1, 1 ] ] ], {n, 0, 38} ]
FactorInteger[#][[1, 1]]&/@(Range[0, 40]!+1) (* Harvey P. Dale, Oct 16 2021 *)
PROG
(PARI) a(n)=factor(n!+1)[1, 1] \\ Charles R Greathouse IV, Dec 05 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved