Skip to content
Surf Wiki
Save to docs
science/mathematics

From Surf Wiki (app.surf) — the open knowledge base

Factorial

Product of numbers from 1 to n

Factorial

Summary

Product of numbers from 1 to n

nn!
01
11
22
36
424
5120
6720
7
8
9
10
11
12
13
14
15
16
17
18
19
20
25
50
52
70
100
450
10
10
10
10
[](googol)10
10

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. The factorial of n also equals the product of n with the next smaller factorial: \begin{align} n! &= n \times (n-1) \times (n-2) \times (n-3) \times \cdots \times 3 \times 2 \times 1 \ &= \begin{cases} 1, & \text{if } n = 0 \ n \times (n-1)!, & \text{if } n \ge 1. \end{cases}\ \end{align} For example, 5! = 5\times 4! = 5 \times 4 \times 3 \times 2 \times 1 = 120. The value of 0! is 1, according to the convention for an empty product.

Factorials have been discovered in several ancient cultures, notably in Indian mathematics in the canonical works of Jain literature, and by Jewish mystics in the Talmudic book Sefer Yetzirah. The factorial operation is encountered in many areas of mathematics, notably in combinatorics, where its most basic use counts the possible distinct sequences – the permutations – of n distinct objects: there are n!. In mathematical analysis, factorials are used in power series for the exponential function and other functions, and they also have applications in algebra, number theory, probability theory, and computer science.

Much of the mathematics of the factorial function was developed beginning in the late 18th and early 19th centuries. Stirling's approximation provides an accurate approximation to the factorial of large numbers, showing that it grows more quickly than exponential growth. Legendre's formula describes the exponents of the prime numbers in a prime factorization of the factorials, and can be used to count the trailing zeros of the factorials. Daniel Bernoulli and Leonhard Euler interpolated the factorial function to a continuous function of complex numbers, except at the negative integers, the (offset) gamma function.

Many other notable functions and number sequences are closely related to the factorials, including the binomial coefficients, double factorials, falling factorials, primorials, and subfactorials. Implementations of the factorial function are commonly used as an example of different computer programming styles, and are included in scientific calculators and scientific computing software libraries. Although directly computing large factorials using the product formula or recurrence is not efficient, faster algorithms are known, matching to within a constant factor the time for fast multiplication algorithms for numbers with the same number of digits.

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, 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. 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.
  • 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. Factorials were also studied for similar reasons by 8th-century Arab grammarian Al-Khalil ibn Ahmad al-Farahidi.
  • In Europe, although Greek mathematics included some combinatorics, and Plato famously used 5,040 (a factorial) as the population of an ideal community, in part because of its divisibility properties, 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. In 1677, British author Fabian Stedman described the application of factorials to change ringing, a musical art involving the ringing of several tuned bells.

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. 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. 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. 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. Adrien-Marie Legendre included Legendre's formula, describing the exponents in the factorization of factorials into prime powers, in an 1808 text on number theory.

The notation n! for factorials was introduced by the French mathematician Christian Kramp in 1808. The word "factorial" (originally French: factorielle) was first used in 1800 by Louis François Antoine Arbogast, in the first work on Faà di Bruno's formula, but referring to a more general concept of products of arithmetic progressions. The "factors" that this name refers to are the terms of the product formula for the factorial.

Definition

The factorial function of a positive integer n is defined by the product of all positive integers not greater than n n! = 1 \cdot 2 \cdot 3 \cdots (n-2) \cdot (n-1) \cdot n. This may be written more concisely in product notation as n! = \prod_{i = 1}^n i.

If this product formula is changed to keep all but the last term, it would 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 n: n! = n\cdot (n-1)!. For example,

Factorial of zero

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

  • For the definition of n! 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.
  • There is exactly one permutation of zero objects: with nothing to permute, the only rearrangement is to do nothing.
  • 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 \tbinom{n}{n} = \tfrac{n!}{n!0!} = 1, a binomial coefficient identity that would only be valid
  • With the recurrence relation for the factorial remains valid Therefore, with this convention, a recursive computation of the factorial needs to have only the value for zero as a base case, simplifying the computation and avoiding the need for additional special cases.
  • Setting 0!=1 allows for the compact expression of many formulae, such as the exponential function, as a power series:
  • This choice matches the gamma function and the gamma function is defined as a continuous function of complex numbers that does not involve a separate choice at this value.

Applications

The earliest uses of the factorial function involve counting permutations: there are n! different ways of arranging n distinct objects into a sequence. Factorials appear more broadly in many formulas in combinatorics, to account for different orderings of objects. For instance the binomial coefficients \tbinom{n}{k} count the k-element combinations (subsets of k elements) from a set with n elements, and can be computed from factorials using the formula \binom{n}{k}=\frac{n!}{k!(n-k)!}. The Stirling numbers of the first kind sum to the factorials, and count the permutations of n grouped into subsets with the same numbers of cycles. Another combinatorial application is in counting derangements, permutations that do not leave any element in its original position; the number of derangements of n items is the nearest integer

In algebra, the factorials arise through the binomial theorem, which uses binomial coefficients to expand powers of sums. 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. Their use in counting permutations can also be restated algebraically: the factorials are the orders of finite symmetric groups. In calculus, factorials occur in Faà di Bruno's formula for chaining higher derivatives. In mathematical analysis, factorials frequently appear in the denominators of power series, most notably in the series for the exponential function, e^x=1+\frac{x}{1}+\frac{x^2}{2}+\frac{x^3}{6}+\cdots = \sum_{k=0}^{\infty}\frac{x^k}{k!}, and in the coefficients of other Taylor series (in particular those of the trigonometric and hyperbolic functions), where they cancel factors of n! coming from the nth derivative of x^n. This usage of factorials in power series connects back to analytic combinatorics through the exponential generating function, which for a combinatorial class with n_i elements of size i is defined as the power series \sum_{k=0}^{\infty} \frac{x^k n_k}{k!}.

In number theory, the most salient property of factorials is the divisibility of n! by all positive integers up to n, described more precisely for prime factors by Legendre's formula. It follows that arbitrarily large prime numbers can be found as the prime factors of the numbers n!\pm 1, leading to a proof of Euclid's theorem that the number of primes is infinite. When n!\pm 1 is itself prime it is called a factorial prime; relatedly, Brocard's problem, also posed by Srinivasa Ramanujan, concerns the existence of square numbers of the form n!+1. In contrast, the numbers n!+2,n!+3,\dots n!+n 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 [n,2n], one of the first results of Paul Erdős, was based on the divisibility properties of factorials. The factorial number system is a mixed radix notation for numbers in which the place values of each digit are factorials.

Factorials are used extensively in probability theory, for instance in the Poisson distribution and in the probabilities of random permutations. In computer science, beyond appearing in the analysis of brute-force searches over permutations, factorials arise in the lower bound of \log_2 n!=n\log_2n-O(n) on the number of comparisons needed to comparison sort a set of n items, Moreover, factorials naturally appear in formulae from quantum and statistical physics, where one often considers all the possible permutations of a set of particles. In statistical mechanics, calculations of entropy such as Boltzmann's entropy formula or the Sackur–Tetrode equation must correct the count of microstates by dividing by the factorials of the numbers of each type of indistinguishable particle to avoid the Gibbs paradox. Quantum physics provides the underlying reason for why these corrections are necessary.

Properties

<math>(n/e)^n</math>,}} on a doubly logarithmic scale
[[Relative error]] in a truncated Stirling series vs. number of terms

Growth and approximation

Main article: Stirling's approximation

As a function of n, the factorial has faster than exponential growth, but grows more slowly than a double exponential function. Its growth rate is similar to n^n, but slower by an exponential factor. One way of approaching this result is by taking the natural logarithm of the factorial, which turns its product formula into a sum, and then estimating the sum by an integral: \ln n! = \sum_{x=1}^n \ln x \approx \int_1^n\ln x, dx=n\ln n-n+1. Exponentiating the result (and ignoring the negligible +1 term) approximates n! as (n/e)^n. More carefully bounding the sum both above and below by an integral, using the trapezoid rule, shows that this estimate needs a correction factor proportional to \sqrt n. The constant of proportionality for this correction can be found from the Wallis product, which expresses \pi as a limiting ratio of factorials and powers of two. The result of these corrections is Stirling's approximation: n!\sim\sqrt{2\pi n}\left(\frac{n}{e}\right)^n,. Here, the \sim symbol means that, as n goes to infinity, the ratio between the left and right sides approaches 1 in the limit. Stirling's formula provides the first term in an asymptotic series that becomes even more accurate when taken to greater numbers of terms: n! \sim \sqrt{2\pi n}\left(\frac{n}{e}\right)^n \left(1 +\frac{1}{12n}+\frac{1}{288n^2} - \frac{139}{51840n^3} -\frac{571}{2488320n^4}+ \cdots \right). An alternative version (the approximation derived directly from the Euler–Maclaurin formula) converges faster because it only requires odd exponents in the correction terms: n! \sim \sqrt{2\pi n}\left(\frac{n}{e}\right)^n \exp\left(\frac{1}{12n} - \frac{1}{360n^3} + \frac{1}{1260n^5} -\frac{1}{1680n^7}+ \cdots \right). Many other variations of these formulas have also been developed, by Srinivasa Ramanujan, Bill Gosper, and others.

The binary logarithm of the factorial, used to analyze comparison sorting, can be very accurately estimated using Stirling's approximation. In the formula below, the O(1) term invokes big O notation. \log_2 n! = n\log_2 n- n \log_2 e + \frac12\log_2 n + O(1).

Divisibility and digits

Main article: Legendre's formula

The product formula for the factorial implies that n! is divisible by all prime numbers that are at most n, and by no larger prime numbers. More precise information about its divisibility is given by Legendre's formula, which gives the exponent of each prime p in the prime factorization of n! as \sum_{i=1}^\infty \left \lfloor \frac n {p^i} \right \rfloor=\frac{n - s_p(n)}{p - 1}. Here s_p(n) denotes the sum of the base-p digits of n, and the exponent given by this formula can also be interpreted in advanced mathematics as the p-adic valuation of the factorial. Grouping the prime factors of the factorial into prime powers in different ways produces the multiplicative partitions of factorials.

The special case of Legendre's formula for p=5 gives the number of trailing zeros in the decimal representation of the factorials. Legendre's formula implies that the exponent of the prime p=2 is always larger than the exponent for so each factor of five can be paired with a factor of two to produce one of these trailing zeros. The leading digits of the factorials are distributed according to Benford's law. Every sequence of digits, in any base, is the sequence of initial digits of some factorial number in that base.

Another result on divisibility of factorials, Wilson's theorem, states that (n-1)!+1 is divisible by n if and only if n is a prime number.}} For almost all numbers (all but a subset of exceptions with asymptotic density zero), it coincides with the largest prime factor of x.

The product of two factorials, m!\cdot n!, always evenly divides (m+n)!. It would follow from the abc conjecture that there are only finitely many nontrivial examples.

The greatest common divisor of the values of a primitive polynomial of degree d over the integers evenly divides d!.

Continuous interpolation and non-integer generalization

The gamma function (shifted one unit left to match the facto&shy;rials) continuously interpolates the factorial to non-integer values
Absolute values of the complex gamma function, showing poles at non-positive integers

Main article: Gamma function

There are infinitely many ways to extend the factorials to a continuous function. The most widely used of these uses the gamma function, which can be defined for positive real numbers as the integral \Gamma(z) = \int_0^\infty x^{z-1} e^{-x},dx. The resulting function is related to the factorial of a non-negative integer n by the equation n!=\Gamma(n+1), which can be used as a definition of the factorial for non-integer arguments. At all values x for which both \Gamma(x) and \Gamma(x-1) are defined, the gamma function obeys the functional equation \Gamma(n)=(n-1)\Gamma(n-1), generalizing the recurrence relation for the factorials.

The same integral converges more generally for any complex number z whose real part is positive. It can be extended to the non-integer points in the rest of the complex plane by solving for Euler's reflection formula \Gamma(z)\Gamma(1-z)=\frac{\pi}{\sin\pi z}. However, this formula cannot be used at integers because, for them, the \sin\pi z term would produce a division by zero. The result of this extension process is an analytic function, the analytic continuation of the integral formula for the gamma function. It has a nonzero value at all complex numbers, except for the non-positive integers where it has simple poles. Correspondingly, this provides a definition for the factorial at all complex numbers other than the negative integers. One property of the gamma function, distinguishing it from other continuous interpolations of the factorials, is given by the Bohr–Mollerup theorem, which states that the gamma function (offset by one) is the only log-convex function on the positive real numbers that interpolates the factorials and obeys the same functional equation. A related uniqueness theorem of Helmut Wielandt states that the complex gamma function and its scalar multiples are the only holomorphic functions on the positive complex half-plane that obey the functional equation and remain bounded for complex numbers with real part between 1 and 2.

Other complex functions that interpolate the factorial values include Hadamard's gamma function, which is an entire function over all the complex numbers, including the non-positive integers. In the p-adic numbers, it is not possible to continuously interpolate the factorial function directly, because the factorials of large integers (a dense subset of the p-adics) converge to zero according to Legendre's formula, forcing any continuous function that is close to their values to be zero everywhere. Instead, the p-adic gamma function provides a continuous interpolation of a modified form of the factorial, omitting the factors in the factorial that are divisible by p.

The digamma function is the logarithmic derivative of the gamma function. Just as the gamma function provides a continuous interpolation of the factorials, offset by one, the digamma function provides a continuous interpolation of the harmonic numbers, offset by the Euler–Mascheroni constant.

Computation

TI SR-50A]], a 1975 calculator with a factorial key (third row, center right)

The factorial function is a common feature in scientific calculators. It is also included in scientific programming libraries such as the Python mathematical functions module and the Boost C++ library.

If efficiency is not a concern, computing factorials is trivial: just successively multiply a variable initialized to 1 by the integers up to n. The simplicity of this computation makes it a common example in the use of different computer programming styles and methods. The computation of n! can be expressed in pseudocode using iteration as define factorial(n): f := 1 for i := 1, 2, 3, ..., n: f := f * i return f or using recursion based on its recurrence relation as define factorial(n): if (n = 0) return 1 return n * factorial(n − 1) Other methods suitable for its computation include memoization, dynamic programming, and functional programming. The computational complexity of these algorithms may be analyzed using the unit-cost random-access machine model of computation, in which each arithmetic operation takes constant time and each number uses a constant amount of storage space. In this model, these methods can compute n! in time O(n), and the iterative version uses space O(1). Unless optimized for tail recursion, the recursive version takes linear space to store its call stack. However, this model of computation is only suitable when n is small enough to allow n! to fit into a machine word. The values 12! and 20! are the largest factorials that can be stored in, respectively, the 32-bit Floating point can represent larger factorials, but approximately rather than exactly, and will still overflow for factorials larger than 170!.

The exact computation of larger factorials involves arbitrary-precision arithmetic, because of fast growth and integer overflow. Time of computation can be analyzed as a function of the number of digits or bits in the result. However, computing the factorial involves repeated products, rather than a single multiplication, so these time bounds do not apply directly. In this setting, computing n! by multiplying the numbers from 1 to n in sequence is inefficient, because it involves n multiplications, a constant fraction of which take time O(n\log^2 n) each, giving total time O(n^2\log^2 n). A better approach is to perform the multiplications as a divide-and-conquer algorithm that multiplies a sequence of i numbers by splitting it into two subsequences of i/2 numbers, multiplies each subsequence, and combines the results with one last multiplication. This approach to the factorial takes total time O(n\log^3 n): one logarithm comes from the number of bits in the factorial, a second comes from the multiplication algorithm, and a third comes from the divide and conquer.

Even better efficiency is obtained by computing n! from its prime factorization, based on the principle that exponentiation by squaring is faster than expanding an exponent into a product. An algorithm for this by Arnold Schönhage begins by finding the list of the primes up to n, for instance using the sieve of Eratosthenes, and uses Legendre's formula to compute the exponent for each prime. Then it computes the product of the prime powers with these exponents, using a recursive algorithm, as follows:

  • Use divide and conquer to compute the product of the primes whose exponents are odd
  • Divide all of the exponents by two (rounding down to an integer), recursively compute the product of the prime powers with these smaller exponents, and square the result
  • Multiply together the results of the two previous steps The product of all primes up to n is an O(n)-bit number, by the prime number theorem, so the time for the first step is O(n\log^2 n), with one logarithm coming from the divide and conquer and another coming from the multiplication algorithm. In the recursive calls to the algorithm, the prime number theorem can again be invoked to prove that the numbers of bits in the corresponding products decrease by a constant factor at each level of recursion, so the total time for these steps at all levels of recursion adds in a geometric series to O(n\log^2 n). The time for the squaring in the second step and the multiplication in the third step are again O(n\log^2 n), because each is a single multiplication of a number with O(n\log n) bits. Again, at each level of recursion the numbers involved have a constant fraction as many bits (because otherwise repeatedly squaring them would produce too large a final result) so again the amounts of time for these steps in the recursive calls add in a geometric series to O(n\log^2 n). Consequentially, the whole algorithm takes time O(n\log^2 n), proportional to a single multiplication with the same number of bits in its result.

References

References

  1. (1988). "Concrete Mathematics". Addison-Wesley.
  2. Jadhav, Dipak. (August 2021). "Jaina Thoughts on Unity Not Being a Number". University of Alberta Libraries.
  3. (2019). "Studies in Indian Mathematics and Astronomy: Selected Articles of Kripa Shankar Shukla". Springer Singapore.
  4. Biggs, Norman L.. (May 1979). "The roots of combinatorics". [[Historia Mathematica]].
  5. Katz, Victor J.. (June 1994). "Ethnomathematics in the classroom". [[For the Learning of Mathematics]].
  6. [https://en.wikisource.org/wiki/Sefer_Yetzirah#CHAPTER_IV Sefer Yetzirah at Wikisource], Chapter IV, Section 4
  7. Rashed, Roshdi. (1980). "Ibn al-Haytham et le théorème de Wilson". [[Archive for History of Exact Sciences]].
  8. Acerbi, F.. (2003). "On the shoulders of Hipparchus: a reappraisal of ancient Greek combinatorics". [[Archive for History of Exact Sciences]].
  9. Katz, Victor J.. (2013). "Combinatorics: Ancient & Modern". [[Oxford University Press]].
  10. 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.
  11. Stedman, Fabian. (1677). "Campanalogia".
  12. Knobloch, Eberhard. (2013). "Combinatorics: Ancient & Modern". [[Oxford University Press]].
  13. (1990). "Numbers". Springer-Verlag.
  14. Dutka, Jacques. (1991). "The early history of the factorial function". [[Archive for History of Exact Sciences]].
  15. Dickson, Leonard E.. (1919). "History of the Theory of Numbers". Carnegie Institution of Washington.
  16. Cajori, Florian. (1929). "A History of Mathematical Notations, Volume II: Notations Mainly in Higher Mathematics". The Open Court Publishing Company.
  17. Miller, Jeff. "Earliest Known Uses of Some of the Words of Mathematics (F)". University of St Andrews.
  18. Craik, Alex D. D.. (2005). "Prehistory of Faà di Bruno's formula". [[The American Mathematical Monthly]].
  19. Arbogast, Louis François Antoine. (1800). "Du calcul des dérivations". L'imprimerie de Levrault, frères.
  20. Dorf, Richard C.. (2003). "CRC Handbook of Engineering Tables". CRC Press.
  21. Hamkins, Joel David. (2020). "Proof and the Art of Mathematics". MIT Press.
  22. (October 2017). "A student asks about (−5)!". [[The Mathematics Teacher]].
  23. (2002). "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.
  24. (1971). "Solved Problems in Analysis: As Applied to Gamma, Beta, Legendre and Bessel Functions". Courier Corporation.
  25. (1998). "The Book of Numbers". Springer Science & Business Media.
  26. Riordan, John. (1958}} [https://books.google.com/books?id=Sbb_AwAAQBAJ&pg=PA76 Reprinted], Princeton Legacy Library, Princeton University Press, 2014, {{isbn). "An Introduction to Combinatorial Analysis". Chapman & Hall.
  27. Randić, Milan. (1987). "On the evaluation of the characteristic polynomial via symmetric function theory". Journal of Mathematical Chemistry.
  28. Hill, Victor E.. (2000). "Groups and Characters". Chapman & Hall.
  29. (2005). "Complexity and Criticality". Imperial College Press.
  30. Wilf, Herbert S.. (2006). "generatingfunctionology". A K Peters.
  31. Ore, Øystein. (1948 }} [https://books.google.com/books?id=Sl_6BPp7S0AC&pg=PA66 Reprinted], Courier Dover Publications, 1988, {{isbn). "Number Theory and Its History". McGraw-Hill.
  32. (2002). "On the primality of n!\pm1 and 2\times3\times5\times\dots\times p\pm1". [[Mathematics of Computation]].
  33. Guy, Richard K.. (2004). "Unsolved Problems in Number Theory". Springer-Verlag.
  34. Neale, Vicky. (2017). "Closing the Gap: The Quest to Understand Prime Numbers". Oxford University Press.
  35. Erdős, Pál. (1932). "Beweis eines Satzes von Tschebyschef". Acta Litt. Sci. Szeged.
  36. Chvátal, Vašek. (2021). "The Discrete Mathematical Charms of Paul Erdős: A Simple Introduction". Cambridge University Press.
  37. Fraenkel, Aviezri S.. (1985). "Systems of numeration". [[The American Mathematical Monthly]].
  38. Pitman, Jim. (1993). "Probability". Springer.
  39. (2006). "Algorithm Design". Addison-Wesley.
  40. (2011). "Algorithms". Addison-Wesley.
  41. Kardar, Mehran. (2007). "Statistical Physics of Particles". [[Cambridge University Press]].
  42. Cameron, Peter J.. (1994). "Combinatorics: Topics, Techniques, Algorithms". Cambridge University Press.
  43. Magnus, Robert. (2020). "Fundamental Mathematical Analysis". Springer.
  44. Palmer, Edgar M.. (1985). "Graphical Evolution: An introduction to the theory of random graphs". John Wiley & Sons.
  45. (2012). "Remarks on asymptotic expansions for the gamma function". Applied Mathematics Letters.
  46. Knuth, Donald E.. (1998). "The Art of Computer Programming, Volume 3: Sorting and Searching". Addison-Wesley.
  47. Beiler, Albert H.. (1966). "Recreations in the Theory of Numbers: The Queen of Mathematics Entertains". Courier Corporation.
  48. {{harvnb. Chvátal. 2021. "1.4: Legendre's formula". pp. 6–7.
  49. Robert, Alain M.. (2000). "A Course in {{nowrap". Springer-Verlag.
  50. (2004). "Chaos and Fractals: New Frontiers of Science". Springer.
  51. (1977). "On the decomposition of n! into prime powers". [[Journal of Number Theory]].
  52. According to this formula, the number of zeros can be obtained by subtracting the base-5 digits of n from n, and dividing the result by four.{{cite OEIS. A027868. Number of trailing zeros in n!; highest power of 5 dividing n!
  53. Koshy, Thomas. (2007). "Elementary Number Theory with Applications". Elsevier.
  54. Diaconis, Persi. (1977). "The distribution of leading digits and uniform distribution mod 1". [[Annals of Probability]].
  55. Bird, R. S.. (1972). "Integers with given initial digits". [[The American Mathematical Monthly]].
  56. Kempner, A. J.. (1918). "Miscellanea". [[The American Mathematical Monthly]].
  57. (1994). "The smallest factorial that is a multiple of {{mvar". [[The American Mathematical Monthly]].
  58. There are infinitely many factorials that equal the product of other factorials: if n is itself any product of factorials, then n! equals that same product multiplied by one more factorial, {{nowrap. (n-1)!. The only known examples of factorials that are products of other factorials but are not of this "trivial" form are {{nowrap. Guy. 2004. "B23: Equal products of factorials". p. 123.
  59. Luca, Florian. (2007). "On factorials which are products of factorials". [[Mathematical Proceedings of the Cambridge Philosophical Society]].
  60. Bhargava, Manjul. (2000). "The factorial function and generalizations". [[The American Mathematical Monthly]].
  61. Davis, Philip J.. (1959). "Leonhard Euler's integral: A historical profile of the gamma function". [[The American Mathematical Monthly]].
  62. (2018). "Gamma and factorial in the ''Monthly''". [[The American Mathematical Monthly]].
  63. Remmert, Reinhold. (1996). "Wielandt's theorem about the {{nowrap". [[The American Mathematical Monthly]].
  64. Alzer, Horst. (2009). "A superadditive property of Hadamard's gamma function". Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg.
  65. {{harvnb. Robert. 2000. "7.1: The gamma function {{nowrap. \Gamma_p". pp. 366–385.
  66. Ross, Bertram. (1978). "The psi function". [[Mathematics Magazine]].
  67. (2014). "Understandable Statistics: Concepts and Methods". Cengage Learning.
  68. "math — Mathematical functions". Python 3 Documentation: The Python Standard Library.
  69. "Factorial". Boost 1.78.0 Documentation: Math Special Functions.
  70. (2009). "Drawing Programs: The Theory and Practice of Schematic Functional Programming". Springer.
  71. Chapman, Stephen J.. (2019). "MATLAB Programming for Engineers". Cengage Learning.
  72. (2014). "The Computing Universe: A Journey through a Revolution". Cambridge University Press.
  73. Bolboaca, Alexandru. (2019). "Hands-On Functional Programming with C++: An effective guide to writing accelerated functional code using C++17 and C++20". Packt Publishing.
  74. Gray, John W.. (2014). "Mastering Mathematica: Programming Methods and Applications". Academic Press.
  75. Torra, Vicenç. (2016). "Scala From a Functional Programming Perspective: An Introduction to the Programming Language". Springer.
  76. Sussman, Gerald Jay. (1982). "Functional Programming and Its Applications: An Advanced Course". Cambridge University Press.
  77. Chaudhuri, Ranjan. (June 2003). "Do the arithmetic operations really execute in constant time?". Association for Computing Machinery.
  78. (March 1997). "Proving assertions is also useful". Association for Computing Machinery.
  79. Fateman, Richard J.. (April 11, 2006). "Comments on Factorial Programs". University of California, Berkeley.
  80. (2021). "Integer multiplication in time O(n \log n)". [[Annals of Mathematics]].
  81. Arndt, Jörg. (2011). "Matters Computational: Ideas, Algorithms, Source Code". Springer.
  82. Borwein, Peter B.. (1985). "On the complexity of calculating factorials". [[Journal of Algorithms]].
  83. Schönhage, Arnold. (1994). "Fast algorithms: a multitape Turing machine implementation". B.I. Wissenschaftsverlag.
  84. {{harvnb. Guy. 2004. "B43: Alternating sums of factorials". pp. 152–153.
  85. Callan, David. (2009). "A combinatorial survey of identities for the double factorial".
  86. Mezey, Paul G.. (2009). "Some dimension problems in molecular databases". Journal of Mathematical Chemistry.
  87. (2010). "Perfect powers in the summatory function of the power tower". [[Journal de Théorie des Nombres de Bordeaux]].
  88. Sagan, Bruce E.. (2020). "Combinatorics: the Art of Counting". American Mathematical Society.
  89. Hardy, G. H.. (1921). "A Course of Pure Mathematics". Cambridge University Press.
  90. (1988). "An Introduction to the Theory of Point Processes". Springer-Verlag.
  91. {{cite OEIS
  92. Kinkelin, H.. (1860). "Ueber eine mit der Gammafunction verwandte Transcendente und deren Anwendung auf die Integralrechung". [[Crelle's Journal.
  93. Glaisher, J. W. L.. (1877). "On the product {{math". [[Messenger of Mathematics]].
  94. (2015). "Generalizations of Wilson's theorem for double-, hyper-, sub- and superfactorials". [[The American Mathematical Monthly]].
  95. {{cite OEIS. A001013. Jordan-Polya numbers: products of factorial numbers
  96. Nelson, Randolph. (2020). "A Brief Journey in Discrete Mathematics". Springer.
  97. Barnes, E. W.. (1900). "The theory of the {{mvar". [[The Quarterly Journal of Pure and Applied Mathematics]].
  98. {{TAOCP
Wikipedia Source

This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page.

Want to explore this topic further?

Ask Mako anything about Factorial — get instant answers, deeper analysis, and related topics.

Research with Mako

Free with your Surf account

Content sourced from Wikipedia, available under CC BY-SA 4.0.

This content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.

Report