Anyone know how to convert this to a function?
$\begin{align} a(n)&=a(n-2)(\frac{n}{n-1}) \\ a(1)&=1 \end{align}$
I understand maybe this can’t be converted to a function because it can’t return anything for even values of n, but maybe a function that has returns the same values for odd values of $n$?
Thanks!
Writing out a few terms, we can see a pattern. For example,
$$a_7=\frac{7}{6}\cdot\frac{5}{4}\cdot\frac{3}{2}\cdot1$$
In general, $$a_n = \frac{n!!}{(n-1)!!}\tag{1}$$ where $!!$ represents the double factorial. This can be proved by induction.
You can also write equation $(1)$ in terms of only normal factorials. For odd $n$, $$n\ odd:\ a_n=\frac{n!}{2^{n-1}((\frac{n-1}{2})!)^2}$$ If you want to also define $a_n$ for even $n$ according to equation $(1)$, then it becomes $$n\ even:\ a_n=\frac{(\frac{n-2}{2})!\ (\frac{n}{2})!\ 2^{n-1}}{(n-1)!}$$