Factorial sums include the sum-of-factorial-powers function, defined for a nonnegative integer
and a positive integer
by
|
(1)
|
For ,
|
(2)
| |||
|
(3)
| |||
|
(4)
|
where
is the exponential integral,
(OEIS A091725),
is the En-function,
is the real
part of
,
and i is the imaginary
number. Here
is the gamma function, and the displayed
is the limit from the upper
half-plane. The first few values for
, 2, ... are 1, 3, 9, 33, 153, 873, 5913, 46233, 409113,
... (OEIS A007489).
cannot be written as a hypergeometric
term plus a constant (Petkovšek et al.
1996). The only prime of this form is
, since
|
(5)
| |||
|
(6)
| |||
|
(7)
|
is always a multiple of 3 for .
In fact,
is divisible by 3 for
and
, 5, 7, ... (since the Cunningham
number given by the sum of the first two terms
is always divisible
by 3--as are all factorial powers in subsequent terms
) and so contains no primes,
meaning sequences with even
are the only prime contenders.
The sum
|
(8)
|
does not appear to have a simple closed-form solution, but its values for , 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
is divisible by 1248829 for
, there can be only a finite number of such primes. (However, the largest such prime
is not known, which is not surprising given that
has more than 14 million decimal
digits.)
is divisible
by 13 for
and the only prime with
is
.
The case of
is slightly more interesting, but
is divisible by 1091 for
and the reported prime
or probable prime terms below that occur at
, 34, and 102 (OEIS A289947).
The only prime in is for
since
is divisible by 13 for
.
Similarly, the only primes in are for
, 4, 5, 16, and 25 (OEIS A290014),
since
is divisible by 41 for
.
The sequence of smallest (prime) numbers such that
is divisible by
for
is given for
, 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),
|
(9)
|
The related sum with alternating terms is known as the alternating factorial,
|
(10)
|
The sum
|
(11)
|
has a simple form, with the first few values for , 2, ... being 1, 5, 23, 119, 719, 5039, ... (OEIS A033312).
Identities satisfied by sums of factorials include
|
(12)
| |||
|
(13)
| |||
|
(14)
| |||
|
(15)
| |||
|
(16)
| |||
|
(17)
| |||
|
(18)
| |||
|
(19)
|
(OEIS A001113, A068985, A070910, A091681,
A073743, A049470,
A073742, and A049469;
Spanier and Oldham 1987), where is a modified
Bessel function of the first kind,
is a Bessel
function of the first kind,
is the hyperbolic cosine,
is the cosine,
is the hyperbolic
sine, and
is the sine.
Sums of factorial powers include
|
(20)
| |||
|
(21)
| |||
|
(22)
| |||
|
(23)
|
(OEIS A091682 and A091683) and, in general, for an integer ,
|
(24)
|
Schroeppel and Gosper (1972) give the integral representation
|
(25)
|
where
|
(26)
| |||
|
(27)
| |||
|
(28)
|
For positive integers and
, define
|
(29)
|
where
is a generalized hypergeometric
function. This family has the finite evaluation
|
(30)
|
where
is the Riemann zeta function,
is a generalized
harmonic number, and
is a binomial coefficient
(T. Kessler, pers. comm., July 2, 2006). Empty sums
are taken as 0, so the case
gives
.
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 of distinct factorial
values which give square numbers, and J. McCranie
gave the one additional sum less than
, excluding the trivial
:
|
(31)
| |||
|
(32)
| |||
|
(33)
| |||
|
(34)
| |||
|
(35)
| |||
|
(36)
| |||
|
(37)
| |||
|
(38)
| |||
|
(39)
| |||
|
(40)
| |||
|
(41)
| |||
|
(42)
| |||
|
(43)
|
and
|
(44)
|
(OEIS A014597). Here distinct values exclude using both
and
,
since they are equal. Allowing those two equal values gives the additional example
|
(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 . For nonnegative
integers
,
, and
, the first identity below holds,
while the second also requires
,
|
(46)
| |||
|
(47)
|
where
is the gamma function, and
is taken as 0 by analytic
continuation when
.