Addition of solution to Project Euler problem 1