Project Euler - problems and solution