python implementation of project euler