def buildFactorialTable(n):
    """
    Build the factorials of all the numbers 1,2,3,...,n
    We will need them all. So, lets compute them also
    bottom up, as in Dynamic Programming.
    """
    result = [1]
    for i in range(n-1):
        result.append(result[-1]*(i+2))
    return result