If you want a formula to calculate n! then you're stuck with the recursive definition: n! = n * (n-1)! with 0! = 1. You could also use the gamma function with n! = gamma(n +1), but you still have to do all the work.