Will these observations be of any help in calculating $n!$ faster?

87 Views Asked by At

Well, hello.

There's a recent observation I had when trying to figure out an easy and time-saving way to calculate $n !$:


If $f(x) = 4x^2 + 2x $, $$ f(1)\cdot f(2)\cdot f(3)\cdot \dots \cdot f(n) = (2n + 1)!,$$ and $$ f\left(\frac{1}{2}\right)\cdot f\left(\frac{3}{2}\right)\cdot f\left(\frac{5}{2}\right)\cdot \dots \cdot f\left(\frac{2n+1}{2}\right) = (2n)!.$$

Will these observations be of any help in calculating $n!$ faster ?

1

There are 1 best solutions below

13
On BEST ANSWER

This is just a trivial rewrite of the factorial's definition. $$n!=\prod_{i=1}^n i \implies (2n+1)!=\prod_{i=1}^{2n+1} i = \prod_{i=1}^{n} (2i)(2i+1) = \prod_{i=1}^{n} f(i)$$ The same goes for the even factorials, I'll leave it to you to show that one. So, no, it will not be faster. You will have $n$ products for $(2n+1)!$, but you will also have to calculate $f(i)$ $n$ times. So you will have to calculate a sum and $3$ products at each step i.e. $f(i)=4\cdot i\cdot i + 2\cdot i$. So overall you have $3n$ products and $n$ sums which is definitely slower than $2n+1$ products.