# Can factorial be done in O(1) and proof?

The typical way to compute the factorial would take $O(n)$ because it calls itself recursively. However, there are many other ways to compute the factorial function based off the gamma function, bessel functions and whatnot. So how would you prove factorial always takes at least $O(n)$ time, no matter how you choose to calculate it? Or can it be done in $O(1)$?

• In which model? What do you count as unit operation? – Evil Oct 16 '17 at 7:35
• Multiplication. – mtheorylord Oct 16 '17 at 7:38
• If you are only allowed to use multiplication, I don't see how you can compute the Gamma function directly. Perhaps you had a more refined model in mind? How about one in which the Gamma function is a primitive operation having unit cost? – Yuval Filmus Oct 16 '17 at 7:55
• No, I am asking the question over all possible algorithms. I just gave the gamma function as an example of a way to compute $n!$. I am interested in how exactly you would go about proving this, – mtheorylord Oct 16 '17 at 7:57
• The unit-cost model is useless here. The output size alone, in bits, is growing quickly. – Raphael Oct 16 '17 at 8:07