Solution for problem 20, leveraging the power of C#'s BigInteger type