gives the alternating factorial
.
AlternatingFactorial
gives the alternating factorial
.
Details
- Mathematical function, suitable for both symbolic and numerical manipulation.
- The function
satisfies the recurrence relation
with
. - AlternatingFactorial can be evaluated to arbitrary numerical precision.
- AlternatingFactorial automatically threads over lists. »
- AlternatingFactorial can be used with Interval and CenteredInterval objects. »
Examples
open all close allBasic Examples (6)
Compute the first few alternating factorials:
Table[AlternatingFactorial[k], {k, 12}]Plot the values on a log scale over a subset of the reals:
DiscretePlot[AlternatingFactorial[k], {k, 12}, ScalingFunctions -> "Log"]Plot over a subset of the complexes:
ComplexPlot3D[AlternatingFactorial[z], {z, -2 - 2I, 2 + 2I}, PlotLegends -> Automatic]Expand the alternating factorial in terms of other functions:
FunctionExpand[AlternatingFactorial[n]]FullSimplify[%, Element[n, Integers]]Give the closed form of the following alternating sum:
Sum[(-1) ^ (n - k)k!, {k, n}]The alternating factorial numbers give the solution to the following recurrence:
a[1] = 1;
a[n_] := a[n] = n! - a[n - 1];Array[a, 12]AlternatingFactorial[Range[12]]Scope (18)
Numerical Evaluation (6)
AlternatingFactorial[1.2]AlternatingFactorial[35]N[AlternatingFactorial[(3/2)], 10]The precision of the output tracks the precision of the input:
AlternatingFactorial[1.20000000000000000000000]AlternatingFactorial can take complex number inputs:
AlternatingFactorial[2.5 + I]Evaluate efficiently at high precision:
AlternatingFactorial[45.`100]//TimingAlternatingFactorial[12.`5000];// TimingCompute the elementwise values of an array using automatic threading:
AlternatingFactorial[{{0, -1}, {-1, 0}}]Or compute the matrix AlternatingFactorial function using MatrixFunction:
MatrixFunction[AlternatingFactorial, {{0, -1}, {-1, 0}}]Compute worst-case guaranteed intervals using Interval and CenteredInterval objects:
AlternatingFactorial[Interval[{1.45, 1.46}]]AlternatingFactorial[CenteredInterval[-1.2, 0.001]]Or compute average-case statistical intervals using Around:
AlternatingFactorial[ Around[2, 0.01]]Specific Values (3)
Values of AlternatingFactorial at fixed points:
Table[AlternatingFactorial[x ], {x, 1, 4}]AlternatingFactorial[0]AlternatingFactorial[x]//FunctionExpandVisualization (2)
Plot the absolute value of AlternatingFactorial:
Plot[Abs[AlternatingFactorial[x]], {x, -1, 5}]ComplexContourPlot[Re[AlternatingFactorial[z]], {z, -3 - 3 I, 3 + 3I}, Contours -> 20]ComplexContourPlot[Im[AlternatingFactorial[z]], {z, -3 - 3 I, 3 + 3I}, Contours -> 20]Function Properties (7)
Real domain of AlternatingFactorial:
FunctionDomain[AlternatingFactorial[x], x]FunctionDomain[AlternatingFactorial[z], z, Complexes]TraditionalForm formatting:
AlternatingFactorial[n]//TraditionalFormAlternatingFactorial is not an analytic function:
FunctionAnalytic[AlternatingFactorial[z], z]AlternatingFactorial has both singularity and discontinuity for z≤-2:
FunctionSingularities[AlternatingFactorial[z], z]FunctionDiscontinuities[AlternatingFactorial[z], z]AlternatingFactorial is neither nondecreasing nor nonincreasing:
FunctionMonotonicity[AlternatingFactorial[z], z]AlternatingFactorial is not injective:
FunctionInjective[AlternatingFactorial[z], z]Plot[{AlternatingFactorial[z], .8}, {z, -3, 3}]AlternatingFactorial is neither non-negative nor non-positive:
FunctionSign[AlternatingFactorial[z], z]It is non-negative on the non-negative reals:
FunctionSign[{AlternatingFactorial[z], z > 0}, z]AlternatingFactorial is neither convex nor concave:
FunctionConvexity[AlternatingFactorial[z], z]Applications (1)
AlternatingFactorial can be defined on the positive integers as follows:
Sum[(-1) ^ (n - i) * i!, {i, 1, n}]Verify the formula for a specific number:
Sum[(-1) ^ (5 - i) * i!, {i, 1, 5}]AlternatingFactorial[5]See Also
Related Guides
Related Links
History
Text
Wolfram Research (2014), AlternatingFactorial, Wolfram Language function, https://reference.wolfram.com/language/ref/AlternatingFactorial.html.
CMS
Wolfram Language. 2014. "AlternatingFactorial." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/AlternatingFactorial.html.
APA
Wolfram Language. (2014). AlternatingFactorial. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AlternatingFactorial.html
BibTeX
@misc{reference.wolfram_2026_alternatingfactorial, author="Wolfram Research", title="{AlternatingFactorial}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/AlternatingFactorial.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_alternatingfactorial, organization={Wolfram Research}, title={AlternatingFactorial}, year={2014}, url={https://reference.wolfram.com/language/ref/AlternatingFactorial.html}, note=[Accessed: 12-June-2026]}