A port of euler.py into node