Index: > A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Business Industries Finance Tax

Home > Factorial


First Prev [ 1 2 3 ] Next Last

3 Calculating factorials

The numeric value of n! can be calculated by repeated multiplication if n is not too large. That is basically what pocket calculators do. The largest factorial that most calculators can handle is 69!, because 70! > 10100.

When n is large, n! can be estimated quite accurately using Stirling's approximation:

4 Logarithm of the factorial

The logarithm of the factorial can be used to calculate the number of digits in a given base the factorial of a given number will take. log n! can easily be calculated as follows:

Note that this function, if graphed, is approximately linear, for small values; but the factor does grow arbitrarily large, although quite slowly. For example, this is the graph of its first 20,000 values:


A good approximation for log n! is to take the logarithm of Stirling's approximation.

5 Generalizations

5.1 The gamma function

The related gamma function Γ(z) is defined for all complex numbers z except for the nonpositive integers (z = 0, −1, −2, −3, ...). It is related to factorials in that it satisfies a recursive relationship similar to that of the factorial function:

Together with the definition Γ(1) = 1 this yields the equation

Because of this relationship, the gamma function is often thought of as a generalization of the factorial function to the domain of complex numbers. This is justified for the following reasons.

5.2 Multifactorials

A common related notation is to use multiple exclamation points to denote a multifactorial, the product of integers in steps of two (n!!), three (n!!!), or more.

n!! denotes the double factorial of n and is defined recursively by

For example, 8!! = 2 · 4 · 6 · 8 = 384 and 9!! = 1 · 3 · 5 · 7 · 9 = 945. The sequence of double factorials (sequence A006882 in OEIS) for n = 0, 1, 2,... starts

1, 1, 2, 3, 8, 15, 48, 105, 384, 945, 3840, ...

Some identities involving double factorials are:

One should be careful not to interpret n!! as the factorial of n!, which would be written (n!)! and is a much larger number.

The double factorial is the most commonly used variant, but one can similarly define the triple factorial (n!!!) and so on. In general, the k-th factorial, denoted by n!(k), is defined recursively as

5.3 Hyperfactorials

Occasionally the hyperfactorial of n is considered. It is written as H(n) and defined by

For n = 1, 2, 3, 4,... the values of H(n) are 1, 4, 108, 27648,... (sequence A002109 in OEIS).

The hyperfactorial function is similar to the factorial, but produces larger numbers. The rate of growth of this function, however, is not much larger than a regular factorial.

5.4 Superfactorials

Neil Sloane and Simon Plouffe defined the superfactorial in 1995 as the product of the first n factorials. So the superfactorial of 4 is
sf(4)=1!*2!*3!*4!=288.

In general

The sequence of superfactorials starts (from n=0) as

1, 1, 2, 12, 288, 34560, 24883200, ... (A000178 in OEIS)

This idea can easily be extended to the superduperfactorial as the product of the first n superfactorials, starting (from n=0) as

1, 1, 2, 24, 6912, 238878720, 5944066965504000, ... (A055462 in OEIS)

and thus recursively to any multiple-level factorial where the mth-level factorial of n is the product of the first n (m-1)th-level factorials, i.e.

where for and .





Non User