# **Dialogue 15 – Generalization of the Collatz function**

**Speaker:** Hello Nara!

In our last conversation, at the end you showed me graphs placed on top of each other and then shifted them. Could you show them to me again? Somehow that reminded me of our reverse analysis.

Nara: With pleasure. Here are the graphs again. And you're right. We always leave out the cycles at the end, because once we reach 1, we have essentially met the stopping criterion.

**Speaker: But why did you choose 31 as the starting value instead of my favorite sequence, 27?**

Nara: Oh, please excuse me! I thought it would be more interesting, because 3n plus 3 to the power of k with the starting value 27 would otherwise be rather boring. Look, if we calculate 3 times 27, we get 81. Now we add our powers of three. These would be: 1, 3, 9, 27, and so on. Here are the sequence values and OddCores over 5 iterations.

And if we take the remainder of the division by 3 to the power of k for each row, it looks like this. So the table contains the results of the modulo-power-of-three operations.

**Speaker: Oh dear, let's leave the numbers aside. They just make me dizzy. What interests me more is whether these 3n plus 3 to the power of k alternative functions also have something like alias values. And how things behave with predecessors.**

Nara: Yes, numbers can make one feel quite unwell! Let's unravel the predecessor issue. We need a few numbers for that, but an even larger portion of logic.

For 3n plus 1, we found that odd predecessors only exist for numbers that are not divisible by three. For 3n plus 3, we found that all following odd numbers are divisible by three. Which numbers then have no odd predecessor?

**Speaker:** **Odd numbers that are not divisible by three?**

Nara: Yes, but there are additional numbers as well.

**Speaker:** **And which ones would those be?**

Nara: If we multiply a power of three by three, the exponent increases, but then we add another three. The number remains divisible by three, but during the sequence it never becomes a power of three again.

**Speaker:** **Doesn't that mean we have found a partial proof that at least all pure powers of three lead to 1 under the original rule?**

Nara: Why do you think so?

**Speaker:** **Look: 3 times three to the power of k plus three to the power of k equals 4 times three to the power of k, and if we apply the rule for even numbers, we end up back at three to the power of k. If we apply our scaling rule n divided by three to the power of k, we arrive at 1. Hooray, we've shown that all three to the power of k lead to 1!**

Nara: Slow down, slow down! I have to stop you there! What you've shown is that all scaled ones fall back to their scaled version. If we substitute three to the power of k into the original rule, the sequence behaves differently. The best example is 27.

**Speaker:** **Okay, but you've just explained mathematically that if, instead of 3, we allow all odd numbers and keep the halving rule, then the function pn plus p to the power of k with starting value n equals p to the power of k forms a cycle.**

Nara: Yes and no. If we substitute n equals p to the power of k, we get: p to the power of k times open parenthesis p plus 1 close parenthesis. And for repeated halving to bring the result back to p to the power of k, the term open parenthesis p plus 1 close parenthesis must be a power of two. This is true for 3, 7, 15, 31, or more generally for so-called Mersenne numbers of the form 2 to the power of x minus 1.

**Speaker:** **Wow, that's quite an insight! And what if I take pn minus p to the power of k?**

Nara: You're really thinking along! If we again substitute n equals p to the power of k, we get: p to the power of k times open parenthesis p minus 1 close parenthesis. Here as well, the term open parenthesis p minus 1 close parenthesis must be a power of two. This is true for 3, 5, 9, 17, or more generally for non-Mersenne numbers of the form 2 to the power of x plus 1. We already talked about this when discussing iteration types and carries. Do you remember?

**Speaker:** **Yes, of course! But wait a moment... Then 3 is a special case?**

Nara: Absolutely! The number 3 has the unique distinction of being the only odd number for which both the addition of 1 and the subtraction of 1 result in a power of two.

**Speaker:** **Ah, I had almost forgotten the 3n minus 1 function! It's quite astonishing that cycles form there precisely at 1, 5, and 17... Does the same thing work there with scaling factors?**

Nara: Yes, absolutely! And it reveals a phenomenon that we do not have in the addition case. There are zeros.

**Speaker:** **What? How do you arrive at zeros?**

Nara: Look, if for 3n minus 3 to the power of k we do not take the power of three itself as the starting value, but rather the preceding power—that is, 3 to the power of k minus 1—then we get:

**Speaker:** **Zero!**

Nara: Exactly!

However, by now we are talking about far more than the original Collatz function. Would you like to pursue this further, or shall we return to 3n plus 1?

**Speaker:** **It's so easy to go from the hundredth to the thousandth. Let's return to 3n plus 1. What do you suggest?**

Nara: Very good! Shall I explain the “magical 24” to you?

**Speaker:** **Gladly, but not right now. Could we continue later?**

Nara: Yes, that was quite a lot again. Get some rest. If you like, you can try out what we discussed yourself. The link is in the video description.


Source: [https://www.3n-1.de/cms/en:collatz:15](https://www.3n-1.de/cms/en:collatz:15)