Project Euler assignment