Solutions to various math problems on Project Euler