Solved Problem 5.

I needed to use the `mod` version of GCD to solve the problem without stack overflow. I could replace the recursive GCD with a loop/recur solution to avoid the stack overflow problem, but it would still have been on the slower side compared to the mod version.