Factorial
The product of the positive integers up to n, written n!.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wikipedia
FactorialMathWorldFactorialWikidataQ120976Encyclopedia of MathematicsFactorialnLabfactorialBritannicatopic/factorialDLMF5.2FungrimFactorial✓Fungrim entryOEISA000142Wolfram LanguageFactorial!mathlib4Nat.factorialRosetta CodeFactorialFactorial(n), the product of the integers from 1 to n.SageMath
enumeratio_factorial(n)SymPyfactorial(n)mpmathfactorial(n)Oscarfactorial(ZZ(n))Juliafactorial(ZZ(n))Rustfactorial(n)Typed signatures
| Type | Package | Applies |
|---|---|---|
(complex | infinity) -> number | compute-engine | always |
(complex | infinity) -> number | number-theoryreplaces compute-engine | always |
Details
- by convention, the empty product.
- Recurrence: .
- Extends to non-integers via the Gamma function, , so half-integer factorials involve .
- Grows faster than any exponential; Stirling's approximation describes the asymptotics.
- compute-engine returns ComplexInfinity at negative integers, the poles of Gamma, rather than leaving the expression unevaluated.
Plot
Examples
Scope #
Properties #
Possible issues #
Negative integers are poles of the Gamma function, so this returns ComplexInfinity rather than staying unevaluated
live ↗InOut
Neat examples #
About
| Examples | 21 |
|---|---|
| Checked against | Wolfram Language 19 agree2 differSageMath 19 agree1 differ1 errorSymPy 20 agree1 errormpmath 16 agree1 errormathlib4 7 agree3 errorOscar 8 agree7 errorJulia 10 agree7 errorRust 10 agree5 error |
| Crosswalk | WikipediaMathWorldWikidataEncyclopedia of MathematicsnLabBritannicaDLMFFungrimFungrim entry ×42OEISWolfram LanguageSageMathSymPympmathmathlib4OscarJuliaRustRosetta Code |
Implementation
mapped
wolframpackages/oracle/src/mappings.tsmapped
sympypackages/oracle/src/mappings.tsmapped
sagepackages/oracle/src/mappings.tsmapped
oscarpackages/oracle/src/mappings.tsmapped
juliapackages/oracle/src/mappings.tsmapped
mathlib4packages/oracle/src/mappings.tsmapped
rustpackages/oracle/src/mappings.tsmapped
mpmathpackages/oracle/src/mappings.ts See also: Binomial, Factorial2, Subfactorial, Pochhammer