Committing problem 5 with an OO approach. Takes about 23.2s to run on my
machine. It should really be much faster than this. Optimizations could
include assuming certain modulo values (2 for instance). I'm sure using
something like Cython would help tremendously too.