Program for Project Euler Problem 1