Project Euler solutions in Python and Ruby