finished Project Euler 31