Project Euler problem 23