<HTML>
<HEAD>
<TITLE>RE: [math-fun] Sum of last ten digits</TITLE>
</HEAD>
<BODY>
<FONT FACE="Courier, Courier New"><SPAN STYLE='font-size:18.0px'><BR>
Graeme, Hans, Neil, ...<BR>
<BR>
About "Sum of last x digits" and loops, findings by Michaël Beeler.<BR>
<BR>
Alexandre<BR>
<BR>
----------------------------<BR>
<BR>
Michael Beeler wrote:<BR>
<FONT COLOR="#008000">> On a related topic, I was puzzled by my results to your previous question<BR>
> about starting with zeros followed by 2, 3, 4... to 9.  In particular, for<BR>
> the cases s=7, s=9, s=11 and s=13, the loop length does not change for<BR>
> using the nine digits 1 through 9.  I looked more carefully at the smallest<BR>
> of these, s=7.  I changed my program to run faster, but restricted to s=7,<BR>
> b=10, and examine all 10^7 starting states.  Amazingly, ALL states fall<BR>
> into the same loop, of length 461.  (That is, all 9,999,999 states.  The<BR>
> all-zeros state is the simple zero-loop of length 1.) <BR>
</FONT><FONT COLOR="#0000FF"><BR>
</FONT><BR>
I wrote:<BR>
<FONT COLOR="#0000FF">The  same loop of lenght 461, is it <BR>
— the very "same" loop, fully identical (all same terms) and beginning by the same "first term" of the loop?<BR>
— the same loop, same terms, fully identical, but in which the sequence enters in another "first term" of the loop?<BR>
— a different loop (different terms) having the same lenght.<BR>
<BR>
My feeling is that it's the second case...<BR>
Is it possible to check some cases of these 9,999,999 beginning states?<BR>
</FONT><BR>
<BR>
<BR>
Michael Beeler writes:<BR>
<BR>
It is the same loop.  All 9,999,999 starting states eventually fall into<BR>
the loop of the same 461 states.<BR>
<BR>
I do not yet know whether it is case 1 or case 2, but I strongly expect it<BR>
is case 2 -- various starting states enter the loop at different places<BR>
among the 461 states.  There are some things I would like to compute about<BR>
the loop and the states falling into it.  One of them is how many of the<BR>
461 states have predecessors outside the loop -- that is, states that enter<BR>
the loop at that place.  Maybe also how many immediate predecessors each of<BR>
the 461 states has -- that is, states that become that state of the loop in<BR>
one step.<BR>
<BR>
I would also like to compute the number of states that are two steps away<BR>
from the loop -- that is, they become a loop state in two steps.  And the<BR>
number that are three steps away, and four steps away, and so on.  I'd like<BR>
to know how many states are at the maximum distance from the loop, and what<BR>
that distance is.  If there are not too many of those at the maximum<BR>
distance, I'd like to list them.<BR>
<BR>
There are more statistics that can be computed about the graph.  For<BR>
instance, at each distance from the graph, the number of states that have<BR>
NO predecessor can be counted.  And the maximum number of predecessors that<BR>
any state at that distance has.  And averages and standard deviations, and<BR>
so on.  But I think this graph is not significant enough to bother with<BR>
these additional statistics.<BR>
<BR>
<BR>
Meanwhile, I had a chance to run the two cases that were so big I gave up<BR>
on them earlier.  These results are for starting with (s-1) zeros followed<BR>
by a 1.<BR>
<BR>
size = 15 digits, radix = 14, loop length = 55702156<BR>
size = 16 digits, radix = 14, loop length = 62748516<BR>
<BR>
<BR>
-------------------<BR>
<BR>
<BR>
<BR>
</SPAN></FONT>
</BODY>
</HTML>