Jump to content

Factorial: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
→‎Related sequences and functions: multifactorial doesn't have a separate article; I don't think it's an important-enough concept to take so much room here
rewrite and source primorials
Line 133: Line 133:
and in the coefficients of other [[Taylor series]], where they cancel factors of <math>n!</math> coming from the <math>n</math>th derivative of <math>x^n</math>.<ref>{{cite book|title=Complexity and Criticality|series=Advanced physics texts|volume=1|first1=Kim|last1=Christensen|first2=Nicholas R.|last2=Moloney|publisher=Imperial College Press|year=2005|isbn=978-1-86094-504-5|contribution=Appendix A: Taylor expansion|page=341|contribution-url=https://books.google.com/books?id=bAIM1_EoQu0C&pg=PA341}}</ref> This usage of factorials in power series connects back to [[analytic combinatorics]] through the [[exponential generating function]], which for a [[combinatorial class]] with <math>n_i</math> elements of size <math>i</math> is defined as the power series<ref>{{cite book | last = Wilf | first = Herbert S. | author-link = Herbert Wilf | edition = 3rd | isbn = 978-1-56881-279-3 | mr = 2172781 | page = 22 | publisher = A K Peters | location = Wellesley, Massachusetts | title = generatingfunctionology | url = https://books.google.com/books?id=XOPMBQAAQBAJ&pg=PA22 | year = 2006}}</ref> <math display=block>\sum_{i=0}^{\infty} \frac{x^i n_i}{i!}.</math>
and in the coefficients of other [[Taylor series]], where they cancel factors of <math>n!</math> coming from the <math>n</math>th derivative of <math>x^n</math>.<ref>{{cite book|title=Complexity and Criticality|series=Advanced physics texts|volume=1|first1=Kim|last1=Christensen|first2=Nicholas R.|last2=Moloney|publisher=Imperial College Press|year=2005|isbn=978-1-86094-504-5|contribution=Appendix A: Taylor expansion|page=341|contribution-url=https://books.google.com/books?id=bAIM1_EoQu0C&pg=PA341}}</ref> This usage of factorials in power series connects back to [[analytic combinatorics]] through the [[exponential generating function]], which for a [[combinatorial class]] with <math>n_i</math> elements of size <math>i</math> is defined as the power series<ref>{{cite book | last = Wilf | first = Herbert S. | author-link = Herbert Wilf | edition = 3rd | isbn = 978-1-56881-279-3 | mr = 2172781 | page = 22 | publisher = A K Peters | location = Wellesley, Massachusetts | title = generatingfunctionology | url = https://books.google.com/books?id=XOPMBQAAQBAJ&pg=PA22 | year = 2006}}</ref> <math display=block>\sum_{i=0}^{\infty} \frac{x^i n_i}{i!}.</math>


In [[number theory]], the most salient property of factorials is the [[divisibility]] of <math>n!</math> by all positive integers up to <math>n</math>, described more precisely for prime factors by [[Legendre's formula]]. It follows that <math>n!\pm 1</math> has only large prime factors, leading to a proof of [[Euclid's theorem]] that the number of primes is infinite. When <math>n!\pm 1</math> is itself prime it is called a [[factorial prime]];<ref>{{cite journal | last1 = Caldwell | first1 = Chris K. | last2 = Gallot | first2 = Yves | doi = 10.1090/S0025-5718-01-01315-1 | issue = 237 | journal = Mathematics of Computation | mr = 1863013 | pages = 441–448 | title = On the primality of <math>n!\pm1</math> and <math>2\times3\times5\times\dots\times p\pm1</math> | volume = 71 | year = 2002}}</ref> relatedly, [[Brocard's problem]], also posed by [[Srinivasa Ramanujan]], concerns the existence of [[square number]]s of the form <math>n!+1</math>.<ref>{{cite book | last = Guy | first = Richard K. | author-link = Richard K. Guy | contribution = D25: Equations involving factorial <math>n</math> | doi = 10.1007/978-0-387-26677-0 | edition = 3rd | isbn = 0-387-20860-7 | mr = 2076335 | pages = 301–302 | publisher = Springer-Verlag | location = New York | series = Problem Books in Mathematics | title = Unsolved Problems in Number Theory | year = 2004}}</ref> In contrast, the numbers <math>n!+2,n!+3,\dots n!+n</math> must all be composite, proving the existence of arbitrarily large [[prime gap]]s. An elementary [[proof of Bertrand's postulate]] on the existence of a prime in any interval of the form <math>[n,2n]</math>, one of the first results of [[Paul Erdős]], was based on the divisibility properties of factorials.<ref>{{cite journal | last = Erdős | first = Pál | author-link = Paul Erdős | journal = Acta Litt. Sci. Szeged | language = de | pages = 194–198 | title = Beweis eines Satzes von Tschebyschef | trans-title = Proof of a theorem of Chebyshev | url = https://users.renyi.hu/~p_erdos/1932-01.pdf | volume = 5 | year = 1932 | zbl = 0004.10103}}</ref> Factorials can be used as a [[primality test]] through [[Wilson's theorem]], which states that a number <math>p</math> is prime if and only if <math display=block>(p-1)! \equiv -1 \pmod p.</math> Factorials are used in the [[factorial number system]], a [[mixed radix]] notation for numbers in which the place values of each digit are factorials.
In [[number theory]], the most salient property of factorials is the [[divisibility]] of <math>n!</math> by all positive integers up to <math>n</math>, described more precisely for prime factors by [[Legendre's formula]]. It follows that <math>n!\pm 1</math> has only large prime factors, leading to a proof of [[Euclid's theorem]] that the number of primes is infinite. When <math>n!\pm 1</math> is itself prime it is called a [[factorial prime]];<ref name=caldwell-gallot>{{cite journal | last1 = Caldwell | first1 = Chris K. | last2 = Gallot | first2 = Yves | doi = 10.1090/S0025-5718-01-01315-1 | issue = 237 | journal = Mathematics of Computation | mr = 1863013 | pages = 441–448 | title = On the primality of <math>n!\pm1</math> and <math>2\times3\times5\times\dots\times p\pm1</math> | volume = 71 | year = 2002}}</ref> relatedly, [[Brocard's problem]], also posed by [[Srinivasa Ramanujan]], concerns the existence of [[square number]]s of the form <math>n!+1</math>.<ref>{{cite book | last = Guy | first = Richard K. | author-link = Richard K. Guy | contribution = D25: Equations involving factorial <math>n</math> | doi = 10.1007/978-0-387-26677-0 | edition = 3rd | isbn = 0-387-20860-7 | mr = 2076335 | pages = 301–302 | publisher = Springer-Verlag | location = New York | series = Problem Books in Mathematics | title = Unsolved Problems in Number Theory | year = 2004}}</ref> In contrast, the numbers <math>n!+2,n!+3,\dots n!+n</math> must all be composite, proving the existence of arbitrarily large [[prime gap]]s. An elementary [[proof of Bertrand's postulate]] on the existence of a prime in any interval of the form <math>[n,2n]</math>, one of the first results of [[Paul Erdős]], was based on the divisibility properties of factorials.<ref>{{cite journal | last = Erdős | first = Pál | author-link = Paul Erdős | journal = Acta Litt. Sci. Szeged | language = de | pages = 194–198 | title = Beweis eines Satzes von Tschebyschef | trans-title = Proof of a theorem of Chebyshev | url = https://users.renyi.hu/~p_erdos/1932-01.pdf | volume = 5 | year = 1932 | zbl = 0004.10103}}</ref> Factorials can be used as a [[primality test]] through [[Wilson's theorem]], which states that a number <math>p</math> is prime if and only if <math display=block>(p-1)! \equiv -1 \pmod p.</math> Factorials are used in the [[factorial number system]], a [[mixed radix]] notation for numbers in which the place values of each digit are factorials.


Factorials are used extensively in [[probability theory]], in formulas for the probabilities of sequences of items where every permutation of the items is equally likely.<ref>{{Cite book |title=Statistical Physics of Particles |last=Kardar |first=Mehran |year=2007 |publisher=Cambridge University Press |isbn=978-0-521-87342-0 |pages=35–56 |language=en |chapter=Chapter 2: Probability |author-link=Mehran Kardar}}</ref>
Factorials are used extensively in [[probability theory]], in formulas for the probabilities of sequences of items where every permutation of the items is equally likely.<ref>{{Cite book |title=Statistical Physics of Particles |last=Kardar |first=Mehran |year=2007 |publisher=Cambridge University Press |isbn=978-0-521-87342-0 |pages=35–56 |language=en |chapter=Chapter 2: Probability |author-link=Mehran Kardar}}</ref>
Line 306: Line 306:
:The notations <math>(x)_{n}</math> or <math>x^{\underline n}</math> are sometimes used to represent the product of the ''n'' integers counting up to and including ''x'', equal to <math>x!/(x-n)!</math>. This is also known as a [[Falling and rising factorials|falling factorial]] or backward factorial, and the <math>(x)_{n}</math> notation is a Pochhammer symbol.{{sfn|Graham|Knuth|Patashnik|1988|pp=x, 47–48}} Falling factorials occur as coefficients in the [[higher derivative]]s of polynomials,<ref>{{cite book|first=G. H.|last=Hardy|author-link=G. H. Hardy|title=A Course of Pure Mathematics|title-link=A Course of Pure Mathematics|edition=3rd|publisher=Cambridge University Press|year=1921|contribution=Examples XLV|page=215|contribution-url=https://archive.org/details/coursepuremath00hardrich/page/n229}}</ref> and count the number of different sequences of <math>n</math> distinct items that can be drawn from a universe of <math>x</math> items.
:The notations <math>(x)_{n}</math> or <math>x^{\underline n}</math> are sometimes used to represent the product of the ''n'' integers counting up to and including ''x'', equal to <math>x!/(x-n)!</math>. This is also known as a [[Falling and rising factorials|falling factorial]] or backward factorial, and the <math>(x)_{n}</math> notation is a Pochhammer symbol.{{sfn|Graham|Knuth|Patashnik|1988|pp=x, 47–48}} Falling factorials occur as coefficients in the [[higher derivative]]s of polynomials,<ref>{{cite book|first=G. H.|last=Hardy|author-link=G. H. Hardy|title=A Course of Pure Mathematics|title-link=A Course of Pure Mathematics|edition=3rd|publisher=Cambridge University Press|year=1921|contribution=Examples XLV|page=215|contribution-url=https://archive.org/details/coursepuremath00hardrich/page/n229}}</ref> and count the number of different sequences of <math>n</math> distinct items that can be drawn from a universe of <math>x</math> items.
;Primorial
;Primorial
:The [[primorial]] <math>n\#</math> is the product of [[prime number]]s less than or equal to <math>n</math>; this construction gives them some similar divisibility properties to factorials,<ref name=caldwell-gallot/> but unlike factorials they are [[squarefree]].<ref>{{cite book | last = Nelson | first = Randolph | doi = 10.1007/978-3-030-37861-5 | isbn = 978-3-030-37861-5 | location = Cham | mr = 4297795 | page = 127 | publisher = Springer | title = A Brief Journey in Discrete Mathematics | url = https://books.google.com/books?id=m8PPDwAAQBAJ&pg=PA127 | year = 2020}}</ref> As with the [[factorial prime]]s <math>n!\pm 1</math>, researchers have studied [[primorial prime]]s <math>n\#\pm 1</math>.<ref name=caldwell-gallot/>
:The [[primorial]] of a natural number {{mvar|n}} {{OEIS|id=A002110}}, denoted {{Math|''n''#}}, is similar to the factorial, but with the product taken only over the [[prime number]]s less than or equal to {{mvar|n}}. That is, <math display=block>n\# = \prod_{p \leq n} p,</math> where {{mvar|p}} ranges over the prime numbers less than or equal to {{mvar|n}}.
;Subfactorial
;Subfactorial
:The subfactorial yields the number of [[Derangement|derangements]] of a set of <math>n</math> objects. It is sometimes denoted <math>!n</math>, and equals the closest integer to <math>n!/e</math>.{{sfn|Graham|Knuth|Patashnik|1988|p=195}}
:The subfactorial yields the number of [[Derangement|derangements]] of a set of <math>n</math> objects. It is sometimes denoted <math>!n</math>, and equals the closest integer to <math>n!/e</math>.{{sfn|Graham|Knuth|Patashnik|1988|p=195}}

Revision as of 08:29, 18 December 2021

Selected factorials; values in scientific notation are rounded
n n!
0 1
1 1
2 2
3 6
4 24
5 120
6 720
7 5040
8 40320
9 362880
10 3628800
11 39916800
12 479001600
13 6227020800
14 87178291200
15 1307674368000
16 20922789888000
17 355687428096000
18 6402373705728000
19 121645100408832000
20 2432902008176640000
25 1.551121004×1025
50 3.041409320×1064
70 1.197857167×10100
100 9.332621544×10157
450 1.733368733×101000
1000 4.023872601×102567
3249 6.412337688×1010000
10000 2.846259681×1035659
25206 1.205703438×10100000
100000 2.824229408×10456573
205023 2.503898932×101000004
1000000 8.263931688×105565708
10100 1010101.9981097754820

In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n:

For example,

The value of 0! is 1, according to the convention for an empty product.[1]

The factorial operation is encountered in many areas of mathematics, notably in combinatorics, algebra, and mathematical analysis. Its most basic use counts the possible distinct sequences – the permutations – of n distinct objects: there are n!.

The factorial function can also be extended to non-integer arguments while retaining its most important properties by defining x! = Γ(x + 1), where Γ is the gamma function; this is undefined when x is a negative integer.

History

The concept of factorials has arisen independently in many cultures:

  • In Indian mathematics, one of the earliest known descriptions of factorials comes from the Anuyogadvāra-sūtra, one of the canonical works of Jain literature, likely dating from 200 BCE to 100 CE. It separates out the sorted and reversed order of a set of items from the other ("mixed") orders, evaluating the number of mixed orders by subtracting two from the usual product formula for the factorial. The product rule for permutations was also described by 6th-century CE Jain monk Jinabhadra.[2] Hindu scholars have been using factorial formulas since at least 1150, when Bhāskara II mentioned factorials in his work Līlāvatī, in connection with a problem of how many ways Vishnu could hold his four characteristic objects (a conch shell, discus, mace, and lotus flower) in his four hands, and a similar problem for a ten-handed god.[3]
  • In the mathematics of the Middle East, the Hebrew mystic book of creation Sefer Yetzirah, from the Talmudic period (200 to 500 CE), lists factorials up to 7! as part of an investigation into the number of words that can be formed from the Hebrew alphabet.[4][5] Factorials were also studied for similar reasons by 8th-century Arab grammarian Al-Khalil ibn Ahmad al-Farahidi.[4]
  • In Europe, although Greek mathematics included some combinatorics, and Plato famously used 5040 (a factorial) as the population of an ideal community, in part because of its divisibility properties,[6] there is no direct evidence of ancient Greek study of factorials. Instead, the first work on factorials in Europe was by Jewish scholars such as Shabbethai Donnolo, explicating the Sefer Yetzirah passage.[7] In 1677, British author Fabian Stedman described the application of factorials to change ringing, a musical art involving the ringing of several tuned bells.[8][9]

From the late 15th century onward, factorials became the subject of study by western mathematicians. In a 1494 treatise, Italian mathematician Luca Pacioli calculated factorials up to 11!, in connection with a problem of dining table arrangements.[10] Christopher Clavius discussed factorials in a 1603 commentary on the work of Johannes de Sacrobosco, and in the 1640s, French polymath Marin Mersenne published large (but not entirely correct) tables of factorials, up to 64!, based on the work of Clavius.[11] The power series for the exponential function, with the reciprocals of factorials for its coefficients, was first formulated in 1676 by Isaac Newton in a letter to Gottfried Wilhelm Leibniz.[12] Other important works of early European mathematics on factorials include extensive coverage in a 1685 treatise by John Wallis, a study of their approximate values for large values of n by Abraham de Moivre in 1721, a 1729 letter from James Stirling to de Moivre stating what became known as Stirling's approximation, and work at the same time by Daniel Bernoulli and Leonhard Euler formulating the continuous extension of the factorial function to the gamma function.[13] Adrien-Marie Legendre included Legendre's formula, describing the exponents in the factorization of factorials into prime powers, in an 1830 text on number theory.[14]

The notation n! for factorials was introduced by the French mathematician Christian Kramp in 1808. Many other notations have also been used. Another later notation, in which the argument of the factorial was half-enclosed by the left and bottom sides of a box, was popular for some time in Britain and America but fell out of use, perhaps because it is difficult to typeset.[15] The word "factorial" (originally French, factorielle) was first used in this sense in 1800 by Louis François Antoine Arbogast, in the first work on Faà di Bruno's formula.[16][17]

Definition

The factorial function of a positive integer is defined by the product[1]

This may be written more concisely in product notation as[1]

In this product formula, all but the last term define a product of the same form, for a smaller factorial. This leads to a recurrence relation, according to which each value of the factorial function can be obtained by multiplying the previous value by :[18]

For example, .

Factorial of zero

The factorial of is , or in symbols, . There are several motivations for this definition:

  • For , the definition of as a product involves the product of no numbers at all, and so is an example of the broader convention that the empty product, a product of no factors, is equal to the multiplicative identity.[19]
  • There is exactly one permutation of zero objects: with nothing to permute, the only rearrangement is to do nothing.[18]
  • This convention makes many identities in combinatorics valid for all valid choices of their parameters. For instance, the number of ways to choose all n elements from a set of n is a binomial coefficient identity that would only be valid for 0! = 1.[20]
  • With , the recurrence relation for the factorial remains valid at , providing the simplest base case for recursive computation of the factorial without need for additional special cases.[21]
  • Setting allows for the compact expression of many formulae, such as the exponential function, as a power series: [12]
  • This choice matches the gamma function , for which it is necessary in order to make the function continuous.[22]

Applications

The earliest uses of the factorial function involve counting permutations: there are n! different ways of arranging n distinct objects into a sequence.[23] Factorials appear more broadly in many formulas in combinatorics, to account for different orderings of objects. For instance the binomial coefficients count the -element combinations (subsets of elements) from a set with elements, and can be computed from factorials using the formula[24]

Another combinatorial application is in counting derangements, permutations that do not leave any element in its original position; the number of derangements of items is the nearest integer to .[25]

In algebra, the factorials arise through the binomial coefficients and the binomial theorem using this theorem to expand products of sums.[26] They also occur in the coefficients used to relate certain families of polynomials to each other, for instance in Newton's identities for symmetric polynomials,[27] and in averaging over permutations for symmetrization. In calculus factorials occur in Faà di Bruno's formula for chaining higher derivatives.[17] In mathematical analysis, factorials frequently appear in the denominators of power series, most notably in the series for the exponential function,[12]

and in the coefficients of other Taylor series, where they cancel factors of coming from the th derivative of .[28] This usage of factorials in power series connects back to analytic combinatorics through the exponential generating function, which for a combinatorial class with elements of size is defined as the power series[29]

In number theory, the most salient property of factorials is the divisibility of by all positive integers up to , described more precisely for prime factors by Legendre's formula. It follows that has only large prime factors, leading to a proof of Euclid's theorem that the number of primes is infinite. When is itself prime it is called a factorial prime;[30] relatedly, Brocard's problem, also posed by Srinivasa Ramanujan, concerns the existence of square numbers of the form .[31] In contrast, the numbers must all be composite, proving the existence of arbitrarily large prime gaps. An elementary proof of Bertrand's postulate on the existence of a prime in any interval of the form , one of the first results of Paul Erdős, was based on the divisibility properties of factorials.[32] Factorials can be used as a primality test through Wilson's theorem, which states that a number is prime if and only if

Factorials are used in the factorial number system, a mixed radix notation for numbers in which the place values of each digit are factorials.

Factorials are used extensively in probability theory, in formulas for the probabilities of sequences of items where every permutation of the items is equally likely.[33] In computer science, beyond appearing in the analysis of brute-force searches over permutations, factorials arise in the lower bound of on the number of comparisons needed to comparison sort a set of items, and in the analysis of chained hash tables, where the probability that a cell of a hash table with load factor contains items is well-approximated by .

Properties

Rate of growth and approximation

Plot of the natural logarithm of the factorial

As n grows, the factorial n! increases faster than all polynomials and exponential functions (but slower than and double exponential functions) in n.

Most approximations for n! are based on approximating its natural logarithm

The graph of the function f(n) = ln n! is shown in the figure on the right. It looks approximately linear for all reasonable values of n, but this intuition is false. We get one of the simplest approximations for ln n! by bounding the sum with an integral from above and below as follows:

which gives us the estimate

Hence ln n! ∼ n ln n (see Big O notation). This result plays a key role in the analysis of the computational complexity of sorting algorithms (see comparison sort). From the bounds on ln n! deduced above we get that

It is sometimes practical to use weaker but simpler estimates. Using the above formula it is easily shown that for all n we have (n/3)n < n!, and for all n ≥ 6 we have n! < (n/2)n.

Comparison of Stirling's approximation with the factorial

For large n we get a better estimate for the number n! using Stirling's approximation:

This in fact comes from an asymptotic series for the logarithm, and n factorial lies between this and the next approximation:

Another approximation for ln n! is given by Srinivasa Ramanujan:[34]

Both this and Stirling's approximation give a relative error on the order of 1/n3, but Ramanujan's is about four times more accurate. However, if we use two correction terms in a Stirling-type approximation, as with Ramanujan's approximation, the relative error will be of order 1/n5:[35]

Divisibility

Legendre's formula gives the multiplicity of the prime p occurring in the prime factorization of n! as

or, equivalently,
where sp(n) denotes the sum of the standard base-p digits of n.

The special case of this formula for gives the number of trailing zeros in the decimal representation of the factorials.

Computation

If efficiency is not a concern, computing factorials is trivial from an algorithmic point of view: successively multiplying a variable initialized to 1 by the integers up to n (if any) will compute n!, provided the result fits in the variable. In functional languages, the recursive definition is often implemented directly to illustrate recursive functions.

The main practical difficulty in computing factorials is the size of the result. To assure that the exact result will fit for all legal values of even the smallest commonly used integral type (8-bit signed integers) would require more than 700 bits, so no reasonable specification of a factorial function using fixed-size types can avoid questions of overflow. The values 12! and 20! are the largest factorials that can be stored in, respectively, the 32-bit and 64-bit integers commonly used in personal computers, however many languages support variable length integer types capable of calculating very large values.[36] Floating-point representation of an approximated result allows going a bit further, but this also remains quite limited by possible overflow. Most calculators use scientific notation with 2-digit decimal exponents, and the largest factorial that fits is then 69!, because 69! < 10100 < 70!. Other implementations (such as computer software such as spreadsheet programs) can often handle larger values.

Most software applications will compute small factorials by direct multiplication or table lookup. Larger factorial values can be approximated using Stirling's formula. Wolfram Alpha can calculate exact results for the ceiling function and floor function applied to the binary, natural and common logarithm of n! for values of n up to 249999, and up to 20000000! for the integers.

If the exact values of large factorials are needed, they can be computed using arbitrary-precision arithmetic. Instead of doing the sequential multiplications ((1 × 2) × 3) × 4..., a program can partition the sequence into two parts, whose products are roughly the same size, and multiply them using a divide-and-conquer method. This is often more efficient.[37]

The asymptotically best efficiency is obtained by computing n! from its prime factorization. As documented by Peter Borwein, prime factorization allows n! to be computed in time O(n(log n log log n)2), provided that a fast multiplication algorithm is used (for example, the Schönhage–Strassen algorithm).[38] Peter Luschny presents source code and benchmarks for several efficient factorial algorithms, with or without the use of a prime sieve.[39]

As an integer sequence

Although the infinite sum of reciprocals of factorials adds to the irrational number ,

it is possible to multiply the factorials by positive integers to produce a convergent series with a rational sum:
The convergence of this series to 1 can be seen from the fact that its partial sums are . Therefore, the factorials do not form an irrationality sequence.[40]

Generalization to of non-integer values

The gamma function interpolates the factorial function to non-integer values. The main clue is the recurrence relation generalized to a continuous domain.

Besides nonnegative integers, the factorial can also be defined for non-integer values, but this requires more advanced tools from mathematical analysis.

One function that fills in the values of the factorial (but with a shift of 1 in the argument), that is often used, is called the gamma function, denoted Γ(z). It is defined for all complex numbers z except for the non-positive integers, and given when the real part of z is positive by

Its relation to the factorial is that n! = Γ(n + 1) for every nonnegative integer n.

The gamma function is certainly not the only way to extend factorials to a function defined at almost all complex values, and not even the only one that is analytic wherever it is defined. Nonetheless it is usually considered the most natural way to extend the values of the factorials to a complex function. For instance, the Bohr–Mollerup theorem states that the gamma function is the only function that takes the value 1 at 1, satisfies the functional equation Γ(n + 1) = nΓ(n), is meromorphic on the complex numbers, and is log-convex on the positive real axis.

Other complex functions that interpolate the factorial values include Hadamard's gamma function which, unlike the gamma function, is an entire function.[41][42]

Approximations

For the large values of the argument, the factorial can be approximated through the logarithm of the gamma function, using a continued fraction representation. This approach is due to T. J. Stieltjes (1894).[43] Writing

Stieltjes gave a continued fraction for :
The first few coefficients are[44]

n an
0 1/12
1 1/30
2 53/210
3 195/371
4 22999/22737
5 29944523/19733142
6 109535241009/48264275462

The continued fraction converges iff .[44] The convergence is poor in the vicinity of the imaginary axis. When , the six coefficients above are sufficient for the evaluation of the factorial with complex double precision. For higher precision more coefficients can be computed by a rational QD scheme (Rutishauser's QD algorithm).[45]

Non-extendability to negative integers

The relation n! = n × (n − 1)! allows one to compute the factorial for an integer given the factorial for a smaller integer. The relation can be inverted so that one can compute the factorial for an integer given the factorial for a larger integer:

However, this recursion does not permit us to compute the factorial of a negative integer; use of the formula to compute (−1)! would require a division of a nonzero value by zero, and thus blocks us from computing a factorial value for every negative integer. Similarly, the gamma function is not defined for zero or negative integers, though it is defined for all other complex numbers.

Related sequences and functions

Several other integer sequences are similar to or related to the factorials:

Alternating factorial
The alternating factorial is the absolute value of the alternating sum of the first factorials, . These have mainly been studied in connection with their primality; only finitely many of them can be prime, but a complete list of primes of this form is not known.[46]
Double factorial
The product of all the odd integers up to some odd positive integer n is called the double factorial of n, and denoted by n!!.[47] That is,
For example, 9!! = 1 × 3 × 5 × 7 × 9 = 945. Double factorials are used in trigonometric integrals,[48] in expressions for the gamma function at half-integers and the volumes of hyperspheres,[49] and in counting binary trees and perfect matchings.[47][50]
Exponential factorial
Just as triangular numbers sum the numbers from to , and factorials take their product, the exponential factorial exponentiates. The exponential factorial of , denoted as , is defined recursively as , with the base case For example,
These numbers grow much more quickly than regular factorials or even hyperfactorials.[51]
Falling factorial
The notations or are sometimes used to represent the product of the n integers counting up to and including x, equal to . This is also known as a falling factorial or backward factorial, and the notation is a Pochhammer symbol.[52] Falling factorials occur as coefficients in the higher derivatives of polynomials,[53] and count the number of different sequences of distinct items that can be drawn from a universe of items.
Primorial
The primorial is the product of prime numbers less than or equal to ; this construction gives them some similar divisibility properties to factorials,[30] but unlike factorials they are squarefree.[54] As with the factorial primes , researchers have studied primorial primes .[30]
Subfactorial
The subfactorial yields the number of derangements of a set of objects. It is sometimes denoted , and equals the closest integer to .[25]

See also

References

  1. ^ a b c Graham, Ronald L.; Knuth, Donald E.; Patashnik, Oren (1988). Concrete Mathematics. Reading, MA: Addison-Wesley. p. 111. ISBN 0-201-14236-8.
  2. ^ Datta, Bibhutibhusan; Singh, Awadhesh Narayan (2019). "Use of permutations and combinations in India". In Kolachana, Aditya; Mahesh, K.; Ramasubramanian, K. (eds.). Studies in Indian Mathematics and Astronomy: Selected Articles of Kripa Shankar Shukla. Sources and Studies in the History of Mathematics and Physical Sciences. Springer Singapore. pp. 356–376. doi:10.1007/978-981-13-7326-8_18.. Revised by K. S. Shukla from a paper in Indian Journal of History of Science 27 (3): 231–249, 1992, MR1189487. See p. 363.
  3. ^ Biggs, Norman L. (May 1979). "The roots of combinatorics". Historia Mathematica. 6 (2): 109–136. doi:10.1016/0315-0860(79)90074-0.
  4. ^ a b Katz, Victor J. (June 1994). "Ethnomathematics in the classroom". For the Learning of Mathematics. 14 (2): 26–30. JSTOR 40248112.
  5. ^ Sefer Yetzirah at Wikisource, Chapter IV, Section 4
  6. ^ Acerbi, F. (2003). "On the shoulders of Hipparchus: a reappraisal of ancient Greek combinatorics". Archive for History of Exact Sciences. 57 (6): 465–502. doi:10.1007/s00407-003-0067-0. JSTOR 41134173. MR 2004966.
  7. ^ Katz, Victor J. (2013). "Chapter 4: Jewish combinatorics". In Wilson, Robin; Watkins, John J. (eds.). Combinatorics: Ancient & Modern. Oxford University Press. pp. 109–121. ISBN 978-0-19-965659-2. See p. 111.
  8. ^ Hunt, Katherine (May 2018). "The Art of Changes: Bell-Ringing, Anagrams, and the Culture of Combination in Seventeenth-Century England". Journal of Medieval and Early Modern Studies. 48 (2): 387–412. doi:10.1215/10829636-4403136.
  9. ^ Stedman, Fabian (1677). Campanalogia. London. pp. 6–9. The publisher is given as "W.S." who may have been William Smith, possibly acting as agent for the Society of College Youths, to which society the "Dedicatory" is addressed.
  10. ^ Knobloch, Eberhard (2013). "Chapter 5: Renaissance combinatorics". In Wilson, Robin; Watkins, John J. (eds.). Combinatorics: Ancient & Modern. Oxford University Press. pp. 123–145. ISBN 978-0-19-965659-2. See p. 126.
  11. ^ Knobloch 2013, pp. 130–133.
  12. ^ a b c Ebbinghaus, H.-D.; Hermes, H.; Hirzebruch, F.; Koecher, M.; Mainzer, K.; Neukirch, J.; Prestel, A.; Remmert, R. (1990). Numbers. Graduate Texts in Mathematics. Vol. 123. New York: Springer-Verlag. p. 131. doi:10.1007/978-1-4612-1005-4. ISBN 0-387-97202-1. MR 1066206.
  13. ^ Dutka, Jacques (1991). "The early history of the factorial function". Archive for History of Exact Sciences. 43 (3): 225–249. doi:10.1007/BF00389433. JSTOR 41133918. MR 1171521.
  14. ^ Dickson, Leonard E. (1919). "Chapter IX: Divisibility of factorials and multinomial coefficients". History of the Theory of Numbers. Vol. 1. Carnegie Institution of Washington. pp. 263–278. See in particular p. 263.
  15. ^ Cajori, Florian (1929). "448–449. Factorial "n"". A History of Mathematical Notations, Volume II: Notations Mainly in Higher Mathematics. The Open Court Publishing Company. pp. 71–77.
  16. ^ Miller, Jeff. "Earliest Known Uses of Some of the Words of Mathematics (F)". MacTutor History of Mathematics archive. University of St Andrews.
  17. ^ a b Craik, Alex D. D. (2005). "Prehistory of Faà di Bruno's formula". American Mathematical Monthly. 112 (2): 119–130. doi:10.1080/00029890.2005.11920176. JSTOR 30037410. MR 2121322.
  18. ^ a b Hamkins, Joel David (2020). Proof and the Art of Mathematics. Cambridge, Massachusetts: MIT Press. p. 50. ISBN 978-0-262-53979-1. MR 4205951.
  19. ^ Dorf, Richard C. (2003). "Factorials". CRC Handbook of Engineering Tables. CRC Press. p. 5-5. ISBN 978-0-203-00922-2.
  20. ^ Goldenberg, E. Paul; Carter, Cynthia J. (October 2017). "A student asks about (−5)!". The Mathematics Teacher. 111 (2): 104–110. doi:10.5951/mathteacher.111.2.0104. JSTOR 10.5951/mathteacher.111.2.0104.
  21. ^ Haberman, Bruria; Averbuch, Haim (2002). "The case of base cases: Why are they so difficult to recognize? Student difficulties with recursion". In Caspersen, Michael E.; Joyce, Daniel T.; Goelman, Don; Utting, Ian (eds.). Proceedings of the 7th Annual SIGCSE Conference on Innovation and Technology in Computer Science Education, ITiCSE 2002, Aarhus, Denmark, June 24-28, 2002. Association for Computing Machinery. pp. 84–88. doi:10.1145/544414.544441.
  22. ^ Farrell, Orin J.; Ross, Bertram (1971). Solved Problems in Analysis: As Applied to Gamma, Beta, Legendre and Bessel Functions. Dover Books on Mathematics. Courier Corporation. p. 10. ISBN 978-0-486-78308-6.
  23. ^ Conway, John H.; Guy, Richard (1998). "Factorial numbers". The Book of Numbers. Springer Science & Business Media. pp. 55–56. ISBN 978-0-387-97993-9.
  24. ^ Graham, Knuth & Patashnik 1988, p. 156.
  25. ^ a b Graham, Knuth & Patashnik 1988, p. 195.
  26. ^ Graham, Knuth & Patashnik 1988, p. 162.
  27. ^ Randić, Milan (1987). "On the evaluation of the characteristic polynomial via symmetric function theory". Journal of Mathematical Chemistry. 1 (1): 145–152. doi:10.1007/BF01205340. MR 0895533.
  28. ^ Christensen, Kim; Moloney, Nicholas R. (2005). "Appendix A: Taylor expansion". Complexity and Criticality. Advanced physics texts. Vol. 1. Imperial College Press. p. 341. ISBN 978-1-86094-504-5.
  29. ^ Wilf, Herbert S. (2006). generatingfunctionology (3rd ed.). Wellesley, Massachusetts: A K Peters. p. 22. ISBN 978-1-56881-279-3. MR 2172781.
  30. ^ a b c Caldwell, Chris K.; Gallot, Yves (2002). "On the primality of and ". Mathematics of Computation. 71 (237): 441–448. doi:10.1090/S0025-5718-01-01315-1. MR 1863013.
  31. ^ Guy, Richard K. (2004). "D25: Equations involving factorial ". Unsolved Problems in Number Theory. Problem Books in Mathematics (3rd ed.). New York: Springer-Verlag. pp. 301–302. doi:10.1007/978-0-387-26677-0. ISBN 0-387-20860-7. MR 2076335.
  32. ^ Erdős, Pál (1932). "Beweis eines Satzes von Tschebyschef" [Proof of a theorem of Chebyshev] (PDF). Acta Litt. Sci. Szeged (in German). 5: 194–198. Zbl 0004.10103.
  33. ^ Kardar, Mehran (2007). "Chapter 2: Probability". Statistical Physics of Particles. Cambridge University Press. pp. 35–56. ISBN 978-0-521-87342-0.
  34. ^ Ramanujan, Srinivasa (1988). The Lost Notebook and Other Unpublished Papers. Springer Berlin. p. 339. ISBN 3-540-18726-X.
  35. ^ Impens, Chris (2003). "Stirling's series made easy". American Mathematical Monthly. 110 (8): 730–735. doi:10.2307/3647856. hdl:1854/LU-284957. JSTOR 3647856. MR 2024001.; see in particular the inequality on p. 732 showing that the relative error is at most .
  36. ^ "wesselbosman/nFactorial". GitHub. 2017-12-25. Archived from the original on 26 April 2018. Retrieved 26 April 2018.
  37. ^ "Factorial Algorithm". GNU MP Software Manual. Archived from the original on 2013-03-14. Retrieved 2013-01-22.
  38. ^ Borwein, Peter (1985). "On the Complexity of Calculating Factorials". Journal of Algorithms. 6 (3): 376–380. doi:10.1016/0196-6774(85)90006-9.
  39. ^ Luschny, Peter. "Fast-Factorial-Functions: The Homepage of Factorial Algorithms". Archived from the original on 2005-03-05.
  40. ^ Guy 2004. "E24: Irrationality sequences". p. 346.
  41. ^ Hadamard, M. J. (1968) [1894]. "Sur L'Expression Du Produit 1·2·3· · · · ·(n−1) Par Une Fonction Entière" (PDF). Œuvres de Jacques Hadamard (in French). Paris: Centre National de la Recherche Scientifiques.
  42. ^ Luschny, Peter. "Hadamard versus Euler – Who found the better Gamma function?". Archived from the original on 2009-08-18.
  43. ^ Char, Bruce W. (April 1980). "On Stieltjes' Continued Fraction for the Gamma Function". Mathematics of Computation. 34 (150): 547–551. doi:10.2307/2006103. JSTOR 2006103.
  44. ^ a b "DLMF: 5.10 Continued Fractions".
  45. ^ Luschny, Peter. "On Stieltjes' Continued Fraction for the Gamma Function". Archived from the original on 2011-05-14.
  46. ^ Guy 2004. "B43: Alternating sums of factorials". pp. 152–153.
  47. ^ a b Callan, David (2009). "A combinatorial survey of identities for the double factorial". arXiv:0906.1317.
  48. ^ Meserve, B. E. (1948). "Classroom Notes: Double Factorials". The American Mathematical Monthly. 55 (7): 425–426. doi:10.2307/2306136. JSTOR 2306136. MR 1527019.
  49. ^ Mezey, Paul G. (2009). "Some dimension problems in molecular databases". Journal of Mathematical Chemistry. 45 (1): 1–6. doi:10.1007/s10910-008-9365-8. S2CID 120103389..
  50. ^ Dale, M. R. T.; Moon, J. W. (1993). "The permuted analogues of three Catalan sets". Journal of Statistical Planning and Inference. 34 (1): 75–87. doi:10.1016/0378-3758(93)90035-5. MR 1209991..
  51. ^ Luca, Florian; Marques, Diego (2010). "Perfect powers in the summatory function of the power tower". Journal de Théorie des Nombres de Bordeaux. 22 (3): 703–718. MR 2769339.
  52. ^ Graham, Knuth & Patashnik 1988, pp. x, 47–48.
  53. ^ Hardy, G. H. (1921). "Examples XLV". A Course of Pure Mathematics (3rd ed.). Cambridge University Press. p. 215.
  54. ^ Nelson, Randolph (2020). A Brief Journey in Discrete Mathematics. Cham: Springer. p. 127. doi:10.1007/978-3-030-37861-5. ISBN 978-3-030-37861-5. MR 4297795.

External links