Factorial2
The double factorial , the product of every second integer from n down to 1 or 2.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wikipedia
Double factorialMathWorldDoubleFactorialWikidataQ13520655nLabdouble factorialFungrimDoubleFactorialFungrim entrya68f0eb6b014OEISA006882Wolfram LanguageFactorial2✓Factorial2(n)the double factorial .SageMath
Integer(n).multifactorial(2)SymPyfactorial2(n)mpmathfac2(n)JuliaCombinatorics.doublefactorial(big(n))Typed signatures
| Type | Package | Applies |
|---|---|---|
(complex | infinity) -> number | analyticreplaces compute-engine | always |
(complex | infinity) -> number | compute-engine | always |
(any) -> any | number-theoryreplaces analytic | always |
Details
- Skips every other factor: , stopping at 1 (n odd) or 2 (n even).
- Recurrence: , with .
- Splits an ordinary factorial into its even and odd parts: .
- counts the perfect matchings of objects into pairs.
- The recurrence run downwards extends it to negative odd integers, ; at negative even integers it hits a pole (a division by the term) and returns NaN.
Examples
Basic #
live ↗
InOut
live ↗
InOut
live ↗
InOut
The number of ways to pair up 10 people into 5 couples: counts perfect matchings of objects
live ↗InOut
Negative even arguments hit a pole in the recurrence, so compute-engine returns ComplexInfinity
live ↗InOut
Possible issues #
$(-\infty)!! $ — the trig-based analytic continuation isn't defined at ; native declines cleanly to Indeterminate
InOut
About
| Examples | 17 |
|---|---|
| Checked against | Wolfram Language 17 agreeSageMath 14 agree3 errorSymPy 14 agree3 errormpmath 16 agree1 errormathlib4 10 agree6 errorJulia 11 agree6 error |
| Crosswalk | WikipediaMathWorldWikidatanLabFungrimFungrim entry ×2OEISWolfram LanguageSageMathSymPympmathJulia |
Implementation
mapped
sympypackages/oracle/src/mappings.tsmapped
mpmathpackages/oracle/src/mappings.tsmapped
sagepackages/oracle/src/mappings.tsmapped
juliapackages/oracle/src/mappings.tsmapped
mathlib4packages/oracle/src/mappings.tsNat.doubleFactorial n, n!! with 0!! = 1!! = 1; natural n only, so the negative odd extension (-1)!! = 1, (-3)!! = -1 is out of its domain.
See also: Factorial