problem 3

Totally took this from http://www.s-anand.net/euler.html