Solutions for project Euler challenge