completes Euler problem 6 with testing