Ask Your Question

Blrp's profile - activity

2020-02-26 12:30:09 +0200 commented answer How do I store a function's results for repeated calls?

Awesome! I didn't think it would be that simple.

2020-02-26 12:27:36 +0200 received badge  Scholar (source)
2020-02-25 20:29:23 +0200 asked a question How do I store a function's results for repeated calls?

In Mathematica one can do this:

factors[n_] := factors[n] = FactorInteger[n]

Then, the first time you call factors[2^385-1], the result is computed, stored, and returned. Next time you make the call, no computation is needed, and the result is returned immediately. How do I do this in Sage?