Solution to Project Euler problems