Python Development, memoized functions.
Alec Mihailovs
alec at mihailovs.com
Fri Jan 5 00:41:36 CET 2007
From: "Alec Mihailovs" <alec at mihailovs.com>
To: "Antti Karttunen" <antti.karttunen at gmail.com>
>> What will happen when you call A000045 multiple times, with varying n
>> (increasing and decreasing
>> at times)?
>
> In this case, certainly, memoization has an advantage.
From other point of view, that also can be done as assigning
A000045=A000045_list(1000)
or with other than 1000 number, greater than the indices needed, and then
using A000045[n] instead of A000045(n) - that would be the same as with
memoization.
Alec
More information about the SeqFan
mailing list