Add Euler problem 31