Solutions to Project Euler problem