Ben Bacarisse writes:
> Daniel Bastos writes:
>
>> def make_sequence_non_recursive(N, x0 = 2, c = -1):
>> "What's wrong with this function? It's very slow."
>> last = x0
>> def sequence():
>> nonlocal last
>>
Chris Angelico writes:
[...]
> Maybe "linear_congruential" would be a good name for the function? I
> don't know.
Sounds good to me --- in absence of a smaller name.
> Anyhow, the basic memoization technique should help you some.
It did! Thanks so much to you and to everyone who contributed
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> Daniel Bastos writes:
>> That function produces a function which yields the values of the
>> sequence x^2 - 1 mod N
>
> Thats a term with two free variables.
> I am not sure what the sequence is.
>
> And if that&
Chris Angelico writes:
> On Mon, Oct 2, 2017 at 8:27 AM, Daniel Bastos wrote:
>> def make_sequence_non_recursive(N, x0 = 2, c = -1):
>> "What's wrong with this function? It's very slow."
>> last = x0
>> def sequence():
>> nonlo
def make_sequence_non_recursive(N, x0 = 2, c = -1):
"What's wrong with this function? It's very slow."
last = x0
def sequence():
nonlocal last
next = last
last = last**2 + c
return next % N
return sequence
It crawls pretty soon. Please advise? Thank you.
>>> f = make_se
Skip Montanaro writes:
[...]
> These two packages would appear to have stalled. Looking around, I also
> found
>
> ws4py
> websockets - Python 3.3 or later
> autobahn.websocket
>
> There are probably others I haven't yet stumbled upon. (I'd continue poking
> around PyPI, but it seems the server