Saturday 26 September 2020

RATS Sequence

Today I turned 26109 days old and one of the properties of this number is that its a member of OEIS A114613:


A114613

Starting numbers for which the RATS sequence has eventual period 3.



The comments in the OEIS entry offered no explanation but there was a link to Eric Weisstein's World of Mathematics, RATS Sequence

A sequence produced by the instructions "reverse, add to the original, then sort the digits." For example, after 668, the next iteration is given by

668+866=1534

so the next term is 1345.

Applied to 1, the sequence gives: 

1, 2, 4, 8, 16, 77, 145, 668, 1345, 6677, 13444, 55778, 133345, 666677, 1333444, 5567777, 12333445, 66666677, 133333444, 556667777, 1233334444, 5566667777, 12333334444, 55666667777, 123333334444, 556666667777, 1233333334444, ... (OEIS A004000).

Conway conjectured that an initial number leads to a divergent period-two pattern (such as the above in which the numbers of threes and sixes in the middles of alternate terms steadily increase) or to a cycle (Guy 2004, p. 404).

The lengths of the cycles obtained by starting with \(n\)= 1, 2, ... are 0, 0, 8, 0, 0, 8, 0, 0, 2, 0, ... (OEIS A114611), where a 0 indicates that the sequence diverges.

The following table summarizes the first few values of \(n\) leading to a period of length \(k\). There are no other periods of length 50 or less for \(n \leq 5 \times 10^7\).

 (E. W. Weisstein, Dec. 19, 2005). 

\(k\)OEIS\(n\) with period \(k\)
inftyA001651  1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 20, ...
2A1146129, 18, 27, 36, 45, 54, 63, 69, 72, 78, 81, 87, 90, 96, ...
3A11461320169, 20709, 21159, 22149, 23139, 24129, 25119, 26109, ...
8A1146143, 6, 12, 15, 21, 24, 30, 33, 39, 42, 48, 51, 57, 60, 66, ...
14A1146156999, 7089, 7179, 7269, 7359, 7449, 7539, 7629, ...
18A11461629, 38, 47, 49, 56, 58, 65, 67, 74, 76, 83, 85, 92, 94, ...

In the case of 26109, it can seen from the following SageMath code that the instructions do indeed lead to a period with length 3 (permalink):

number=26109
L=[number]
while len(L)==Set(L).cardinality():
    N=number.digits()
    reversal=0
    for n in range(0, len(N)):
        reversal+=N[n]*10^(len(N)-n-1)
    number=number+reversal
    D=sorted(number.digits())
    index, number=0,0
    for d in D:
        number+=d*10^(len(D)-index-1)
        index+=1
    L.append(number)
print(L)

[26109, 111267, 337788, 1122255, 4446666, 1111113, 2222244, 4446666]

Here is a little more background surrounding this sequence, taken from this site:

Princeton mathematician John Horton Conway calls this the RATS sequence (for “reverse, add, then sort”) and in 1989 conjectured that no matter what number you start with (in base 10), you’ll either enter the divergent pattern above or find yourself in some cycle. Conway’s colleague at Princeton, Curt McMullen, showed that the conjecture is true for all numbers less than a hundred million, and himself conjectured that every RATS sequence in bases smaller than 10 is eventually periodic. Are they right? So far neither conjecture has been disproved. 

There seems to be however, another version of the RATS sequence with members generated using the following rule:

Write down an integer. Remove any zeros and sort the digits in increasing order. Now add this number to its reversal to produce a new number, and perform the same operations on that and so on. Source.

Applying this to 26109, we see that it does produce a loop but its period is 2 (1170 --> 828 --> 1170) not 3 (4446666 --> 1111113 --> 2222244 --> 4446666) as was the case with our original steps:

26109 —> 2619 —> 1269 —> 1269 + 9621 —> 10890

10890 —> 189 —> 189 + 981 —> 1170

1170 —> 117 —> 117 + 711 —> 828

828 —> 288 —> 288 + 882 —> 1170 

 The original instructions are more straightforward and don't require removal of any zeroes. 

No comments:

Post a Comment