On Mon, Oct 2, 2017 at 11:34 AM, Steve D'Aprano <steve+pyt...@pearwood.info> wrote: >> change it to >> >> last = (last**2 + c) % N >> return next > > Better: > > last = (pow(last, 2, N) + (2 % N)) % N > > will almost certainly be faster for large values of last.
I think possibly you mean (c % N) in the middle there? Not sure but there ought to be a reference to c somewhere. ChrisA -- https://mail.python.org/mailman/listinfo/python-list