Algebra > Sums >

Factorial Sums

DOWNLOAD Mathematica Notebook

The sum-of-factorial powers function is defined 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)+R[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, R[z] is the real part of z, and i is the imaginary number. The first few values 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!^n+2!^n=2^n+1 is always divisible by 3--as are all factorial powers in subsequent terms n>=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, but its values for n=1, 2, ... are 1, 5, 41, 617, 15017, 533417, 25935017, ... (OEIS A104344). It is 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 checking the terms below that gives the only prime terms as 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 sometimes denoted L!n (not to be confused with the subfactorial) and known as the left factorial,

 L!n=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 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,

 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)

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

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

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

and

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

(OEIS A014597).

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 example

 sum_(k=0)^N1/((k+m)!(k+n)!)=_1F^~_2(1;m+1,n+1;1) 
 -_1F^~_2(1;m+N+2;n+N+2;1)  
sum_(k=0)^N1/((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)).
(44)

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.