Project Euler #253: Tidying up