Digit Sum Procedure using ANS

Take any positive integer in some base, and sum the digits. Then convert the 
integer to a base that is equal to this digit sum. Repeat this procedure
until either the digit sum equals the base, or a cycle of integers occurs.
Once again, I use base ten (A) with ANS to represent the digits is each base.
In ENS, this procedure is quite a bit different due to the different 
behaviour of the digit zero from the other digits, and the integer 10000 
"degenerates" to base 1. This does not happen in ANS, and therefore ANS is 
much more consistent using this procedure.

Some examples:

I will start with base ten (A) for familiarity, and progress to other numbers
involving ANS.

A number such as 136(A) is what I call self-terminating, since its digit sum
equals the base : 1+3+6 = A

A number such as 124(A) = 235(7).  This is a 2-cycle since the digit sum 
of one number equals the base of the other.


Another example:
Using the number 437(A) = 19 x 23, start at base 2, although any base is 
equally valid.

437(A) = 21221221(2) (sum of the digits is 13) = 2.7.8(13)
2.7.8(13) = 1.8.12(17) = 1A.17(21) 
= 11.2A(37) = A.27(41) = (2-cycle)
and these last two form a 2-cycle that repeats since the digit sum of one
is the base of the other.

Using the same number 437(A) in base 3:
= 113312(3) = 3.6.8(11) = 1.8.12(17) = 1A.17(21) 
= 11.2A(37) = A.27(41) = (same 2-cycle above)

If we use one of the factors of 437(A) = 19 x 23 as the base :
= 1.3.19(19) = 18.23(23) = A.27(41) = 11.2A(37) and the same 2-cycle occurs.
Notice that the two factors of the number (19 & 23) occur together in this
example.

----------------------------------------------------------------------------

Another situation is with numbers of the Repunit/Mersenne type.
G(b,n) = b^n - 1 = 111...111(base b) with n digits all equal to 1.

Since the digits are all 1, therefore n equals the sum of the digits as well
as the number of digits.
Therefore, using this procedure, G(b,n) can be converted to base n.

Examine Mersenne numbers/primes when n is prime using this procedure.
2^n-1 is prime for n = 2,3,5,7,13,17,19,31,61,89,...
But is composite for other prime values of n = 11,23,29,37,41,43,...

2^2-1 = 11(2) and terminates
2^3-1 = 21(3) and terminates
2^5-1 = 111(5) = 311(3) (2-cycle)
2^7-1 = 241(7) and terminates
2^11-1 = 1.5.A.1(11) = 7.1.7(17) = 9.1.7(15) (2-cycle)
2^13-1 = 3.9.6.1(13) = 1.3.13.2(19) and terminates
2^17-1 = 1.9.11.9.1(17) (Palindrome) = 4.12.12.3(31) and terminates
2^19-1 = 2.19.8.6.1(19) = A.12.35.34(37) = 63.28.36(91) 
       = 32.64.31(127) and terminates
2^23-1 = 1.6.22.A.11(23) ... this is a long one (16 terms) 
         and terminates at 3.17.23.96(139)
2^29-1 = 26.5.1.24.2.1(29) ... another long one (9 terms), 
         and ending in a 2-cycle  = 6A7.587.447(871) = 177.212.482(1741)
and so on...

----------------------------------------------------------------------------

More things to explore:

(1) Why are the cycles so short? How long can they get and why?
(2) What happens in other bases?
(3) What happens with other types of numbers?
(4) Why do the factors of the number often occur together?
(5) Why do several numbers converge to the same cycle or terminator?

Lots more to explore.

Enjoy.

Return to the Main Menu

Last modified Oct.3 1997