Let $n!^{(k)}$ denote a multi-factorial which is defined by $$ n!^{(k)} = \begin{cases} 1 & n \leqslant 0, \\ n, & 0 < n < k,\\ n\times(n-k)!^{(k)}, & n \geqslant k. \end{cases} $$
E.g. $8!^{(3)}=8\times5!^{(3)}=8\times5\times2!^{(3)}=8\times5\times2=80$. For $k=3$ we may also put down $8!!!$.
For the case of $k=1$, Mathematica has Factorial[]
or !
at hand.
For the case of $k=2$, there is Factorial2[]
or !!
which calculates double factorials.
For the general case of a $k$th factorial, I could define by recursion
In[1]:= MultiFactorial[n_, k_] := If[n < k, If[n <= 0, 1, n], n MultiFactorial[n - k, k]]
which correctly outputs $8!^{(3)}$ as
In[2]:= MultiFactorial[8, 3]
Out[2]:= 80
But when I have a multi-factorial in every term of an infinite series, Mathematica spits out the original input:
In[3]:= Sum[((-1)^n MultiFactorial[3 n, 3])/MultiFactorial[3 n + 1, 3], {n, 0, +∞}]
Out[3]:= (* More or less the same *)
[Edit]
Definition by Product[]
In[4]:= MultiFactorial[n_, k_] := Product[i, {i, n, 1, -k}]
In[5]:= Sum[((-1)^n MultiFactorial[3 n, 3])/MultiFactorial[3 n + 1, 3], {n, 0, +∞}]
suggests that the sum is divergent.
Yep, I'm trying to verify if
$$\sum\limits_{n=0}^{+\infty} \frac{(-1)^n (3n)!^{(3)}}{(3n+1)!^{(3)}} = -\frac{\sqrt[3]{2}}{4} \ln\left(\sqrt[3]{2}-1\right)+\frac{\sqrt{3}\sqrt[3]{2}}{6}\arctan\frac{\sqrt{3}}{1+2\sqrt[3]{2}}.$$
Question: Are there any built-in functions for the cases of $k\geqslant3$ which is OK to sum?
MultiFactorial[n_, k_] := With[{q = Quotient[n - 1, k]}, k^(q + 1) Gamma[n/k + 1]/Gamma[n/k - q]]
$\endgroup$N[Hypergeometric2F1[1, 1, 4/3, -1]]
which is $0.590718\cdots$, the same as the given result. Why the difference?Prod
doesn't seem to be non-recursive? And I'm now trying to comprehending yours. $\endgroup$