Project Euler problem 30