Super long Project Euler 31