The residue of a sequence is calculated by counting the number of odd and even terms in a descent and then calculating 2even/(x * 3odd). If we choose x=7, for instance we get the series [7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1], which has 11 even and 5 odd members (we don't count the '1'), so:
Eric Roosendaal introduces residues on one of his pages - http://personal.computrain.nl/eric/wondrous/residues.htm, where he discusses the non-uniformity of the distribution and postulates that the largest residue is R(993):
On the rest of this page we will discus the distribution of the residue values and speculate on whether R(993) really is the largest value. My distribution will be slightly different from Eric's as I ignore the even numbers.
I've taken all the odd numbers in the range 3-1048575 (220-1) and divided their residues into bins of 0.001, in the range 1-1.260. The resulting distribution looks like

Clearly this is non-uniform. There is a large gap between 1.012 and 1.065 (actually there is one entry at R(21)=1.015873... which doesn't register on the chart) and numerous smaller gaps. The colour coding is explained in a later section.
If we have a number 'x' and its residue R(x) we can use reverse iteration to find the residues of its immediate odd precursors. For a number 'x' of the form 6n+1 the smallest odd precursor is 8n+1, and for 6n+5 it is 4n+3. The sequences continue:
Each value is 4 times the previous one, plus 1. The backward residue multipliers are (2k*x)/ (3 * xback), where 'k' is 2,4,6,... for 6n+1 and 1,3,5,...for 6n+5. The first iterations give
We can obtain the other multipliers by repeatedly iterating a/3b -> 4a/3(4b+1), or the simpler but equivalent a/b -> 4a/(4b+3). But as a is always b+1, we have (b+1)/b -> 4(b+1)/(4b+3) = (4b+4)/(4b+3) = 1 + 1/(4b+3).
If we replace n by (x-1)/6 or (x-5)/6 we get
For positive 'n' all these multipliers are greater than 1, so the residues of the precursors of a number will always be greater than the residue of the number itself. If there is a largest residue then it must be a multiple of 3 (as multiples of 3 don't have precursors).
From the previous section we see that all odd numbers not divisible by 3 have an infinite number of immediate precursors. This diagram shows the first few for '1'. The labels show the number of iterations.

When discussing domains of attraction, we noticed that most (small) numbers pass through 5 on their way to one. These domains are used as the basis of the colour coding in the above chart. The half a million values used to construct the above chart are colour coded acording to which of these values they pass through on their way to 1. The details for each domain are shown in the table.
|
The multiples of 3 (21, 1365, ...) can only ever have one value so they
don't really enter into the calculation. The values generated by the 85
and 341 sub-domains overlap but are confined to very small values compared
to 5 (though there is no guarantee this is the case when we include the
infinite set). The other values, 5461 etc. don't lead to any values
greater than 1.001 which is why they don't feature in the above chart. This is a close up view of the range 1-1.015 where the contribution from 21845 becomes visible. 5461 is still too small to register. ![]() |
If we run the reverse iteration for 1 we get the precursors and residues:
| Precursor | Residue |
| 5 | 1 + 1/15 |
| 21 | 1 + 1/63 |
| 85 | 1 + 1/255 |
| 341 | 1 + 1/1023 |
| 1365 | 1 + 1/4095 |
| 5461 | 1 + 1/16383 |
| 21845 | 1 + 1/65535 |
| 87381 | 1 + 1/262143 |
| 349525 | 1 + 1/1048575 |
| ... | ... |
The second value of each pair is how much the residue will be multiplied by when moving from 1 to the corresponding precursor, but as R(1) = 1, so R(5) = 1+1/15. Because the residue always increases as we move back up the tree all values that converge on 5 will have a residue greater than 1+1/15. Similarly all the values that converge on 85 will have a residue greater than 1+1/255 and those that converge on 341, 1+1/1023. This explains the leftmost extent of the distributions, but doesn't constrain the right.
The structure of the 5-domain is also quite complicated. We can use reverse iteration again to find the immediate precursors of 5 and their residue multipliers (shown in the next table). To get the actual residues the numbers in the second column need to be multiplied by R(5)=16/15. We also show the number of iterations that start with numbers in the range that 3-1048575 that go through each, and the range of residue values encountered. The first row represents '5' which doesn't go through a precursor.
| Precursor | Multiplier | Residue | Frequency | Min | Max | |
|---|---|---|---|---|---|---|
| - | 1 + 1/15 | 1.066666666667 | 1 | 1.066 | 1.066 | |
| 3 | 1 + 1/9 | 1 + 5/27 | 1.185185185185 | 1 | 1.185 | 1.185 |
| 13 | 1 + 1/39 | 1 + 11/117 | 1.0940170940171 | 249,018 | 1.094 | 1.253 |
| 53 | 1 + 1/159 | 1 + 35/477 | 1.0733752620545 | 239,467 | 1.073 | 1.198 |
| 213 | 1 + 1/639 | 1 + 131/1917 | 1.0683359415754 | 1 | 1.068 | 1.068 |
| 853 | 1 + 1/2559 | 1 + 515/7677 | 1.0670834961574 | 2,577 | 1.067 | 1.068 |
| 3,413 | 1 + 1/10239 | 1 + 2051/30717 | 1.0667708435069 | 756 | 1.066 | 1.067 |
| 13,653 | 1 + 1/40959 | 1 + 8195/122877 | 1.0666927089691 | 1 | 1.066 | 1.066 |
| 54,613 | 1 + 1/163839 | 1 + 32771/491517 | 1.0666731771231 | 25 | 1.066 | 1.066 |
| 218,453 | 1 + 1/655359 | 1 + 131075/1966077 | 1.0666682942733 | 4 | 1.066 | 1.066 |
| 873,813 | 1 + 1/2621439 | 1 + 524291/7864317 | 1.0666670735679 | 1 | 1.066 | 1.066 |
The chart obtained by plotting these values looks like this. The uniform block that represented '5' in the previous chart now has 4 noticeable sub-components, of which two (13 and 53) cover a significant range.

The next graph shows the 13 and 53 routes further sub-divided.

It looks like all largish residues (for starting values less than 1048576) will pass through 35,53,5,1 or 17,13,5,1, with all values over 1.2 taking the second route.
The residues of a number's precursors are always larger than that of the number itself. The problem is that for largish numbers the increment is quite small. To obtain a large residue we therefore need a sequence with plenty of small numbers. All the tractable examples of this sort of sequence have been studied and the conclusion is that R(993) is the largest residue. To disprove this we would have to find a very long sequence, with very big numbers, where a lot of very small increments combine to overcome this.
![]() |
The image on the left shows the descent of 993, R(993)=1.2531421. The
branches show the points along this descent where the route doesn't follow
the path of maximum residue multiplier. For instance at 43 (R=1.2389) the possible
precursors were 57, 229 and 917. The corresponding inverse residue
multipliers were
![]() This shows that although 673 might have appeared a better option at the time, 2693 had more potential overall and eventually produced the record holder at 993. 3973 is the next predecessor of 745 after 993 and would be a good candidate to start a search for higher residues from. I extended the above search out to 10 million but the shape of the chart was almost unchanged. |
![]() |
The charts on the left show the results of what I call "Value Limited
Backward Searching", based on the seed of 3973, R=1.252827. The
results are divided into bins of 0.00001. VLBS works by taking the seed and calculating all the immediate precursors that are less than the limit. For 3973 and a limit of 1000000 these are 5297, 21189, 84757 and 339029. We then repeat this process on all the precursors, building up a list of all the numbers that converge on the seed without venturing outside the limit. This won't find all the values in a given range, though it will get most of those less than the square root of the range. The charts on the left show the application of this algorithm with widths of 1 million, 10m, 100m and 1 billion. Notice how the distribution hardly changes. The little peak to the right of the first chart represents 3531, where R=1.253024. |
![]() |
This works by taking a seed and finding the 'n' smallest precursors, 'n' being the width. The next iteration works by finding the precursors of the current set of 'n' values and extracting the 10 smallest. There is no stopping condition for this search, we can either stop when the smallest value is greater than some threshold or after a fixed number of iterations (depth). If we try this for a seed of 5, with a width of 4 and depth of 5 we get the chart on the left. Because this algorithm only takes the smallest values for each iteration it has the potential to miss interesting results. In this example, for instance, the branch at 61 is chopped off. Using a width of 4 would also miss 993. This is because the precursor, 917, appears in the 12th column, as can be seen in the next table, which shows how the iteration would progress with a width of 12. |
| 3 | 13 | 53 | 213 | 853 | 3413 | 13653 | 54613 | 218453 | 873813 | 3495253 | 13981013 |
| 17 | 35 | 69 | 141 | 277 | 565 | 1109 | 1137 | 2261 | 2275 | 4437 | 4549 |
| 11 | 23 | 45 | 93 | 181 | 369 | 373 | 725 | 739 | 753 | 1477 | 1493 |
| 7 | 15 | 29 | 61 | 117 | 241 | 245 | 469 | 483 | 497 | 965 | 981 |
| 9 | 19 | 37 | 77 | 81 | 149 | 163 | 309 | 321 | 325 | 331 | 597 |
| 25 | 49 | 51 | 99 | 101 | 197 | 205 | 217 | 397 | 405 | 433 | 441 |
| 33 | 65 | 67 | 131 | 133 | 261 | 269 | 273 | 289 | 525 | 529 | 533 |
| 43 | 87 | 89 | 173 | 177 | 179 | 349 | 355 | 357 | 385 | 693 | 705 |
| 57 | 59 | 115 | 119 | 229 | 237 | 461 | 465 | 473 | 477 | 513 | 917 |
| 39 | 79 | 153 | 157 | 305 | 307 | 315 | 317 | 611 | 613 | 629 | 1221 |
| 105 | 203 | 209 | 211 | 407 | 409 | 419 | 421 | 813 | 817 | 837 | 845 |
| 135 | 139 | 271 | 279 | 281 | 541 | 545 | 557 | 561 | 563 | 1085 | 1089 |
| 185 | 187 | 361 | 363 | 371 | 375 | 721 | 723 | 741 | 749 | 1445 | 1453 |
| 123 | 247 | 249 | 481 | 493 | 499 | 961 | 963 | 989 | 997 | 1925 | 1937 |
| 329 | 641 | 657 | 659 | 665 | 1281 | 1283 | 1291 | 1317 | 1329 | 2565 | 2629 |
| 219 | 427 | 439 | 443 | 855 | 877 | 1709 | 1721 | 1757 | 1773 | 3421 | 3505 |
| 295 | 569 | 585 | 1139 | 1147 | 1169 | 1171 | 1181 | 2277 | 2341 | 4557 | 4561 |
| 379 | 393 | 759 | 779 | 787 | 1517 | 1529 | 1561 | 1573 | 3037 | 3117 | 3121 |
| 505 | 519 | 1011 | 1019 | 1049 | 2021 | 2077 | 2081 | 2097 | 4045 | 4049 | 4077 |
| 673 | 679 | 699 | 1347 | 1387 | 2693 | 2699 | 2717 | 2769 | 2797 | 5389 | 5393 |
| 897 | 905 | 1795 | 1799 | 1811 | 1849 | 3589 | 3595 | 3621 | 3729 | 7181 | 7185 |
| 603 | 1199 | 1207 | 2393 | 2413 | 2465 | 4785 | 4787 | 4793 | 4797 | 4829 | 9573 |
| 799 | 1595 | 1609 | 1643 | 3191 | 3195 | 3197 | 3217 | 3219 | 6381 | 6437 | 6573 |
| 1063 | 1065 | 1095 | 2127 | 2131 | 2145 | 4253 | 4261 | 4289 | 4291 | 4381 | 8509 |
| 1417 | 2835 | 2841 | 2859 | 5669 | 5681 | 5721 | 5841 | 11341 | 11345 | 11365 | 11437 |
| 1889 | 3779 | 3787 | 7557 | 7563 | 15117 | 15121 | 15149 | 15153 | 15249 | 30229 | 30253 |
| 1259 | 2519 | 5037 | 5049 | 10077 | 10099 | 20149 | 20161 | 20197 | 40305 | 40309 | 40337 |
| 839 | 1679 | 3357 | 6717 | 13429 | 13465 | 26865 | 26869 | 26881 | 26891 | 26929 | 53717 |
| 559 | 1119 | 2237 | 4477 | 8949 | 17905 | 17909 | 17927 | 17953 | 35797 | 35811 | 35825 |
| 745 | 1491 | 2981 | 5965 | 5969 | 11925 | 11939 | 11951 | 23861 | 23873 | 23877 | 23883 |
| 993 | 1987 | 3973 | 3979 | 7949 | 7953 | 7959 | 7967 | 15893 | 15907 | 15915 | 15917 |
![]() ![]() ![]() |
The residues generated from the above table are shown in the chart on the
left. If you compare this chart with the earlier ones you will see that
here the residues are clustered more towards the right. So although this
algorithm has flaws it does tend to find the higher residues. If we extend the iteration to a depth of 300 we get the second chart, where all the values are crammed up at the right hand edge. The 3rd chart is a log10 chart of the spike in the second chart. This only shows values greater than one so 993 at 1.2531 doesn't appear. By the 300th iteration the numbers and residues we were working with are shown in the following table.
|
|||||||||||||||||||||||||
![]() |
The chart on the left shows the effect (on the log plot) of widening the
search to 24. It's found a few more of the very high ones around 1.2529
but the current search value is R(4556863913839675) = 1.25211, which is
actually worse than the narrower search. The largest non multiple of 3 found along the way R(250817) = 1.2529895. This and the other top 10 values found form part of a tree routed at 5297 (R = 1.2529), which is one of the predecessors of 3973 (R=1.2528) we found earlier. |
| Working Backwards: The forward equation we introduced above is quite straight forward. This page explores working backward to find a number's predecessors. |
| Domains of Attraction: Before converging on one, sequences must pass through one of one's predecessors (1, 5, 21, etc). This pages explores the relative popularity of these gateways. |
| Residue Records: Although 993 is probably the largest , if we ignore multiples of three the numbers keep growing. |