TOPICS
Search

Factorial Sums


Factorial sums include the sum-of-factorial-powers function, defined for a nonnegative integer n and a positive integer p by

 sf^p(n)=sum_(k=1)^nk!^p.
(1)

For p=1,

sf^1(n)=sum_(k=1)^(n)k!
(2)
=(-e+Ei(1)+pii+E_(n+2)(-1)Gamma(n+2))/e
(3)
=(-e+Ei(1)+Re[E_(n+2)(-1)]Gamma(n+2))/e,
(4)

where Ei(z) is the exponential integral, Ei(1) approx 1.89512 (OEIS A091725), E_n is the En-function, Re[z] is the real part of z, and i is the imaginary number. Here Gamma(z) is the gamma function, and the displayed E_(n+2)(-1) is the limit from the upper half-plane. The first few values for n=1, 2, ... are 1, 3, 9, 33, 153, 873, 5913, 46233, 409113, ... (OEIS A007489). sf^1(n) cannot be written as a hypergeometric term plus a constant (Petkovšek et al. 1996). The only prime of this form is sf^1(2)=3, since

sf^1(n)=(1!+2!+3!+...+n!)
(5)
=(1+2+3sum_(k=3)^(n)(k!)/3)
(6)
=3(1+sum_(k=3)^(n)(k!)/3)
(7)

is always a multiple of 3 for n>2.

In fact, sf^p(n) is divisible by 3 for n>1 and p=3, 5, 7, ... (since the Cunningham number given by the sum of the first two terms 1!^p+2!^p=2^p+1 is always divisible by 3--as are all factorial powers in subsequent terms k>=3) and so contains no primes, meaning sequences with even p are the only prime contenders.

The sum

 sf^2(n)=sum_(k=1)^n(k!)^2
(8)

does not appear to have a simple closed-form solution, but its values for n=1, 2, ... are 1, 5, 41, 617, 15017, 533417, 25935017, ... (OEIS A104344). It is reported to be prime or a probable prime for indices 2, 3, 4, 5, 7, 8, 10, 18, 21, 42, 51, 91, 133, 177, 182, 310, 3175, 9566, 32841, ... (OEIS A100289). Since sf^2(n) is divisible by 1248829 for n>=1248828, there can be only a finite number of such primes. (However, the largest such prime is not known, which is not surprising given that sf^2(1248829) has more than 14 million decimal digits.)

sf^4(n) is divisible by 13 for n>=12 and the only prime with n<12 is sf^4(2)=17.

The case of sf^6(n) is slightly more interesting, but sf^6(n) is divisible by 1091 for n>=1090 and the reported prime or probable prime terms below that occur at n=5, 34, and 102 (OEIS A289947).

The only prime in sf^8(n) is for n=2 since sf^8(n) is divisible by 13 for n>=12.

Similarly, the only primes in sf^(10)(n) are for n=3, 4, 5, 16, and 25 (OEIS A290014), since sf^(10)(n) is divisible by 41 for n>=40.

The sequence of smallest (prime) numbers a_k such that sf^(2k)(n) is divisible by a_k for n>=a_k-1 is given for k=1, 2, ... by 1248829, 13, 1091, 13, 41, 37, 463, 13, 23, 13, 1667, 37, 23, 13, 41, 13, 139, ... (OEIS A290250).

The related sum with index running from 0 instead of 1 is a shifted left factorial (not to be confused with the subfactorial),

 L!(n+1)=sum_(k=0)^nk!.
(9)

The related sum with alternating terms is known as the alternating factorial,

 a(n)=sum_(k=1)^n(-1)^(n-k)k!.
(10)

The sum

 sum_(k=1)^nkk!=(n+1)!-1
(11)

has a simple form, with the first few values for n=1, 2, ... being 1, 5, 23, 119, 719, 5039, ... (OEIS A033312).

Identities satisfied by sums of factorials include

sum_(k=0)^(infty)1/(k!)=e=2.718281828...
(12)
sum_(k=0)^(infty)((-1)^k)/(k!)=e^(-1)=0.3678794411...
(13)
sum_(k=0)^(infty)1/((k!)^2)=I_0(2)=2.279585302...
(14)
sum_(k=0)^(infty)((-1)^k)/((k!)^2)=J_0(2)=0.2238907791...
(15)
sum_(k=0)^(infty)1/((2k)!)=cosh1=1.543080634...
(16)
sum_(k=0)^(infty)((-1)^k)/((2k)!)=cos1=0.5403023058...
(17)
sum_(k=0)^(infty)1/((2k+1)!)=sinh1=1.175201193...
(18)
sum_(k=0)^(infty)((-1)^k)/((2k+1)!)=sin1=0.8414709848...
(19)

(OEIS A001113, A068985, A070910, A091681, A073743, A049470, A073742, and A049469; Spanier and Oldham 1987), where I_0(x) is a modified Bessel function of the first kind, J_0(x) is a Bessel function of the first kind, coshx is the hyperbolic cosine, cosx is the cosine, sinhx is the hyperbolic sine, and sinx is the sine.

Sums of factorial powers include

sum_(n=0)^(infty)((n!)^2)/((2n)!)=2/(27)(18+sqrt(3)pi)
(20)
=1.73639985...
(21)
sum_(n=0)^(infty)((n!)^3)/((3n)!)=_3F_2(1,1,1;1/3,2/3;1/(27))
(22)
=1.17840325...
(23)

(OEIS A091682 and A091683) and, in general, for an integer k>=2,

 sum_(n=0)^infty((n!)^k)/((kn)!)=_kF_(k-1)(1,...,1_()_(k);1/k,2/k,...,(k-1)/k;1/(k^k)).
(24)

Schroeppel and Gosper (1972) give the integral representation

 sum_(n=0)^infty((n!)^3)/((3n)!)=int_0^1[P(t)+Q(t)cos^(-1)R(t)]dt,
(25)

where

P(t)=(2(8+7t^2-7t^3))/((4-t^2+t^3)^2)
(26)
Q(t)=(4t(1-t)(5+t^2-t^3))/((4-t^2+t^3)^2sqrt((1-t)(4-t^2+t^3)))
(27)
R(t)=1-1/2(t^2-t^3).
(28)

For positive integers b and k, define

 S_(b,k)=sum_(n=0)^infty((n!)^2)/((n+b)!(n+k)!)=_3F_2(1,1,1;b+1,k+1;1)1/(b!k!),
(29)

where _3F_2 is a generalized hypergeometric function. This family has the finite evaluation

 S_(b,k)=((b+k-2)!)/([(b-1)!]^2[(k-1)!]^2)[zeta(2)-H_(b-1,2)-sum_(j=1)^(k-1)1/(j^2(b+j-1; j)),
(30)

where zeta is the Riemann zeta function, H_(m,2)=sum_(j=1)^(m)j^(-2) is a generalized harmonic number, and (r; s) is a binomial coefficient (T. Kessler, pers. comm., July 2, 2006). Empty sums are taken as 0, so the case b=k=1 gives S_(1,1)=zeta(2)=pi^2/6.

There are only four integers equal to the sum of the factorials of their decimal digits. Such numbers are called factorions.

While no factorial greater than 1! is a square number, D. Hoey listed sums <10^(12) of distinct factorial values which give square numbers, and J. McCranie gave the one additional sum less than 21! approx 5.1×10^(19), excluding the trivial 1!=1^2:

1!+2!+3!=3^2
(31)
1!+4!=5^2
(32)
1!+5!=11^2
(33)
4!+5!=12^2
(34)
1!+2!+3!+6!=27^2
(35)
1!+5!+6!=29^2
(36)
1!+7!=71^2
(37)
4!+5!+7!=72^2
(38)
1!+2!+3!+7!+8!=213^2
(39)
1!+4!+5!+6!+7!+8!=215^2
(40)
1!+2!+3!+6!+9!=603^2
(41)
1!+4!+8!+9!=635^2
(42)
1!+2!+3!+6!+7!+8!+10!=1917^2
(43)

and

 1!+2!+3!+7!+8!+9!+10!+11!+12!+13!+14!+15!=1183893^2
(44)

(OEIS A014597). Here distinct values exclude using both 0! and 1!, since they are equal. Allowing those two equal values gives the additional example

 0!+1!+2!=2^2.
(45)

Sums with powers of an index in the numerator and products of factorials in the denominator can often be done analytically in terms of regularized hypergeometric functions _pF^~_q. For nonnegative integers m, n, and N, the first identity below holds, while the second also requires N<=n,

sum_(k=0)^(N)1/((k+m)!(k+n)!)=_1F^~_2(1;m+1,n+1;1)-_1F^~_2(1;m+N+2,n+N+2;1)
(46)
sum_(k=0)^(N)1/((m+k)!(n-k)!)=(_2F^~_1(1,-n;m+1;-1))/(Gamma(n+1))-(_2F^~_1(1,-n+N+1;m+N+2;-1))/(Gamma(n-N)),
(47)

where Gamma(z) is the gamma function, and 1/Gamma(0) is taken as 0 by analytic continuation when N=n.


See also

Alternating Factorial, Binomial Sums, Factorial, Factorial Products, Integer Sequence Primes, Left Factorial, Subfactorial

Explore with Wolfram|Alpha

References

Guy, R. K. "Equal Products of Factorials," "Alternating Sums of Factorials," and "Equations Involving Factorial n." §B23, B43, and D25 in Unsolved Problems in Number Theory, 2nd ed. New York: Springer-Verlag, pp. 80, 100, and 193-194, 1994.Petkovšek, M.; Wilf, H. S.; and Zeilberger, D. A=B. Wellesley, MA: A K Peters, 1996. https://www2.math.upenn.edu/~wilf/AeqB.html.Schroeppel, R. and Gosper, R. W. Item 116 in Beeler, M.; Gosper, R. W.; and Schroeppel, R. HAKMEM. Cambridge, MA: MIT Artificial Intelligence Laboratory, Memo AIM-239, p. 54, Feb. 1972. https://www.inwap.com/pdp10/hbaker/hakmem/series.html#item116.Sloane, N. J. A. Sequences A001113/M1727, A007489/M2818, A014597, A033312, A049469, A049470, A068985, A070910, A073742, A073743, A091681, A091682, A091683, A091725, A100289, A104344, A289947, A290014, and A290250 in "The On-Line Encyclopedia of Integer Sequences."Spanier, J. and Oldham, K. B. "The Factorial Function n! and Its Reciprocal." Ch. 2 in An Atlas of Functions. Washington, DC: Hemisphere, pp. 19-33, 1987.

Referenced on Wolfram|Alpha

Factorial Sums

Cite this as:

Weisstein, Eric W. "Factorial Sums." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/FactorialSums.html

Subject classifications