sum of factorial of n numbers formula