Solved P31-35 (arithmetic)