This is a solution to project euler problem 1.