Monday, 28 October 2024

Number + SOD - POD Sequences

In this post, I will be using SOD as meaning the Sum Of Digits of a number and POD as meaning the Product Of Digits of a number. Consider a number like 27602 that is the number associated with my diurnal age today. What happens if I repeatedly add the sum of its digits and subtract the product of its digits? Because it contains the digit zero, its POD is initially 0 but this soon changes as I repeat the process. Here is the 27602's trajectory that consists of 26 steps (permalink):

276002, 276019, 276044, 276067, 276095, 276124, 275474, 267663, 258621, 257685, 240918, 240942, 240963, 240987, 241017, 241032, 241044, 241059, 241080, 241095, 241116, 241083, 241101, 241110, 241119, 241065, 241083

As can be seen, a loop is reached. What about 27610? Its trajectory consists of 27 steps (permalink):

27610, 27626, 26641, 26372, 25888, 20799, 20826, 20844, 20862, 20880, 20898, 20925, 20943, 20961, 20979, 21006, 21015, 21024, 21033, 21042, 21051, 21060, 21069, 21087, 21105, 21114, 21115

There is no loop here so why does the sequence terminate with 21115. The answer is that this number has a SOD (2 + 1 + 1 + 1 + 5 = 10) equal to its POD (2 x 1 x 1 x 1 x 5 = 10). So for every number, the corresponding sequence will have a finite number of steps ending in either a loop or a number with SOD = POD. 

What's of interest now are the progressive record lengths of the sequences as we consider larger and larger numbers. Table 1 shows the record lengths up to 110,000. 

Around 10,000 it can be seen that there is a big jump from 39 (9541) to 85 (9980) and again aroud 100,000 there is an even bigger jump from 98 (98907) to 631 (99970). If I were to continue there would be another big jump around one million. The sequence of numbers with record lengths is:

1, 10, 400, 417, 432, 482, 730, 2200, 2217, 2232, 2282, 2800, 2903, 3610, 4601, 5177, 6821, 7248, 9380, 9541, 9980, 9990, 10002, 98907, 99970, 99980, 99990, 100008

This sequence is not listed in the OEIS and I certainly won't be proposing it for inclusion. Variations on this theme are of course possible. For example, the product of digits could exclude the digit 0. This digit makes no difference to the sum of a number's digits but it has the effect of always sending the product of its digits to zero.

This makes a big difference to the sequence of record lengths and we no longer get those big jumps around 10,000, 100,000 and 1,000,000. Firstly though, let's go back to the original number 27601 and see how its trajectory is affected. The new trajectory is:

27601, 27533, 26923, 26297, 24811, 24763, 23777, 21745, 21484, 21247, 21151

The initial product of digits is now not zero but 2 x 7 x 6 x 1 = 84. The sum of its digits is still 16 but the SOD - POD now becomes 16 - 84 = -68 and so the next number in the sequence is 27533. The sequence ends with 21151 which has its SOD = POD.

The record lengths are shown in Table 2.


Table 2

The sequence of numbers with record lengths with zero not counting in the POD is now as follows:

1, 11, 100, 810, 1918, 1931, 2614, 2831, 2905, 3149, 3226, 3638, 3943, 4116, 4228, 4290, 4543, 6242, 7504, 7600, 7730, 8152, 8405, 9714, 19911, 23191, 23318, 23470, 25364, 27001, 29270, 44573, 45552, 46680, 47163, 47730, 49434, 54181, 54641, 55418, 56100, 57135, 71620, 73191, 73302, 74620, 75210, 78543, 81200, 82452, 83292, 87294, 88803, 95900, 97630, 98180, 100000, 100002

On the subject of numbers from 10 up to 100,000 in which SOD = POD, it is only these combination of digits that satisfy (permalink):

[2, 2], [1, 2, 3], [1, 1, 2, 4], [1, 1, 1, 2, 5], [1, 1, 1, 3, 3], [1, 1, 2, 2, 2]

There are 68 numbers in the range from 1 to 100,000 that satisfy SOD = POD and they are:

1, 2, 3, 4, 5, 6, 7, 8, 9, 22, 123, 132, 213, 231, 312, 321, 1124, 1142, 1214, 1241, 1412, 1421, 2114, 2141, 2411, 4112, 4121, 4211, 11125, 11133, 11152, 11215, 11222, 11251, 11313, 11331, 11512, 11521, 12115, 12122, 12151, 12212, 12221, 12511, 13113, 13131, 13311, 15112, 15121, 15211, 21115, 21122, 21151, 21212, 21221, 21511, 22112, 22121, 22211, 25111, 31113, 31131, 31311, 33111, 51112, 51121, 51211, 52111

However, if we don't include zero in the product of digits then there are 164 numbers that qualify because we can insert zeros into all the above numbers with impunity. Of course this means that some numbers will exceed 100,000 and so will not be included in the list below (permalink).

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 22, 30, 40, 50, 60, 70, 80, 90, 123, 132, 202, 213, 220, 231, 312, 321, 1023, 1032, 1124, 1142, 1203, 1214, 1230, 1241, 1302, 1320, 1412, 1421, 2013, 2020, 2031, 2103, 2114, 2130, 2141, 2301, 2310, 2411, 3012, 3021, 3102, 3120, 3201, 3210, 4112, 4121, 4211, 10124, 10142, 10203, 10214, 10230, 10241, 10302, 10320, 10412, 10421, 11024, 11042, 11125, 11133, 11152, 11204, 11215, 11222, 11240, 11251, 11313, 11331, 11402, 11420, 11512, 11521, 12014, 12030, 12041, 12104, 12115, 12122, 12140, 12151, 12212, 12221, 12401, 12410, 12511, 13020, 13113, 13131, 13311, 14012, 14021, 14102, 14120, 14201, 14210, 15112, 15121, 15211, 20103, 20114, 20130, 20141, 20301, 20310, 20411, 21014, 21030, 21041, 21104, 21115, 21122, 21140, 21151, 21212, 21221, 21401, 21410, 21511, 22112, 22121, 22211, 23010, 24011, 24101, 24110, 25111, 30102, 30120, 30201, 30210, 31020, 31113, 31131, 31311, 32010, 33111, 40112, 40121, 40211, 41012, 41021, 41102, 41120, 41201, 41210, 42011, 42101, 42110, 51112, 51121, 51211, 52111

If we try reversing the order of the subtraction so that we have number + POD - SOD, the POD soon causes the sequences for many numbers to increase without bound. In the case of POD with zeros counted, the number 23 was the first to exceed a sequence length of 700. When zeros were not counted, 516 was the first number to exceed 700. 

No comments:

Post a Comment