Project Euler problem code