Completed Project Euler problem 001