Project Euler solutions in Python and C++