Speeded up euler.py