Euler Project solution on Python with IPython notebook