Talk:Summarize and say sequence: Difference between revisions

Line 28:
::: OEIS says "this kind of counting sequence", so maybe "digit counting sequence"? If name has to be "*verb*-and say", the verb is better as "Count" IMO since sorting is not essential. --[[User:Ledrug|Ledrug]] 00:42, 24 August 2011 (UTC)
::::+1 --[[User:Paddy3118|Paddy3118]] 04:55, 25 August 2011 (UTC)
 
==Caching==
The perl example has a note about the calcolation 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"'''
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>
I have no version without those possible speed-ups, but the code ran in a minute or two for a million starting numbers and maybe Perl would run in an acceptable time as, in general, Perl 5 and Python have similar run times for similar algorithms I find. --[[User:Paddy3118|Paddy3118]] 05:06, 25 August 2011 (UTC)
Anonymous user