modified:   euler40.py