Project Euler #245: Coresilience