>>20
You store the first 2 * n ** 0.5
R values encoded in your groups
list. If you computed work_seq(10000)
and dumped its internal state before returning, you couldn't just restore it and continue to R(20000), you would have to recompute the R values that were not saved.