A solution to problem three found on projecteuler.net/problems