Project Euler done in (most) functional python