Talk:Summarize and say sequence: Difference between revisions
Content added Content deleted
(→Explanation request: added count-and-say instead of sort, then look and say. -- ~~~~) |
m (→Caching: corrected misspelling of "calcolation". -- ~~~~) |
||
Line 32: | Line 32: | ||
==Caching== |
==Caching== |
||
The perl example has a note about the |
The perl example has a note about the calculation to a million takes a long time. For the Python solution, I took note of the comment on [http://oeis.org/A036058 the OEIS page] |
||
:''"This kind of counting sequence is always periodic with period 1, 2 or 3"''' |
:''"This kind of counting sequence is always periodic with period 1, 2 or 3"''' |
||
And set up a ring buffer of the last three terms as a cache and also did not compute the series for starting values that had permuted digits of a starting number that had come before.<br> |
And set up a ring buffer of the last three terms as a cache and also did not compute the series for starting values that had permuted digits of a starting number that had come before.<br> |