find the kth factorial of any number n