# Special Collatz Sequence

**URL:** https://fortran-lang.discourse.group/t/special-collatz-sequence/8869
**Category:** Help
**Created:** [November 22, 2024, 1:49pm UTC](https://fortran-lang.discourse.group/t/special-collatz-sequence/8869 "2024-11-22T13:49:10Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![mecej4](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/mecej4/32/855_2.png) [@mecej4](https://fortran-lang.discourse.group/u/mecej4)
#### Post date: [November 22, 2024, 1:49pm UTC](https://fortran-lang.discourse.group/t/special-collatz-sequence/8869/1 "2024-11-22T13:49:10Z")

</div>

**A special Collatz Sequence** :

Let n \> 0 be a positive integer, and take  
x\_0 = (4^n-1)/(4-1).  
It is easy to show that x\_0 is a positive odd integer.

Construct the [Collatz sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) starting with x\_0.  
Application of the “3x+1 if odd” rule gives x\_1=4^n, which  
is even. 2n applications of the “halve if even” rule gives  
the terminal value 1. Thus, for the special value x\_0  
that we have chosen, 2n+1 steps take us to the terminal value 1.  
We can construct Collatz sequences of any desired length by  
this method, with a predetermined initial value and the terminal  
value 1. All the intermediate values are powers of 2, and can  
be written down without the need for any numerical calculation.

Has this property of the Collatz sequence been noted earlier?

Thanks.

* * *

Here are values of x\_0 and x\_1 for a few small values of n  
n x\_0 x\_1  
1 1 4  
2 5 16  
3 21 64  
4 85 256  
5 341 1024  
6 1365 4096  
7 5461 16384  
8 21845 65536  
9 87381 262144  
10 349525 1048576  
11 1398101 4194304  
12 5592405 16777216  
Thanks to @septc’s reply below in #2, I was able to find an [older post](https://math.stackexchange.com/questions/2716155/are-there-specific-numbers-for-which-the-collatz-conjecture-is-proven/2785829#2785829) on the topic with related initial values that throws more light on my question, on [math.stackexchange.com](http://math.stackexchange.com)  
P.S. If we name the starting value as s\_n, the following recurrence relation is easily derived: `s_{n+1} = 4 s_n + 1`  
`

---

<div class="post-metadata">

### Author: ![septc](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/septc/32/77_2.png) [@septc](https://fortran-lang.discourse.group/u/septc)
#### Post date: [November 22, 2024, 9:26pm UTC](https://fortran-lang.discourse.group/t/special-collatz-sequence/8869/2 "2024-11-22T21:26:58Z")

</div>

I have no idea about “Collatz sequence”, so just tried asking Perplexity. Then, it seems that this property is known in the literature, but the conjecture itself is still an open problem in math (emphasis by me below). I am a bit surprised by the response of Perplexity because it is very clear, though I don’t know whether it is correct or not… ChatGPT also seems to give a similar response.

- [Question & Answer on Perplexity](https://www.perplexity.ai/search/let-n-0-be-a-positive-integer-H1pEjRphTnSbfhgH05wbtw)

> **Full text**
>
> This is an interesting observation about a specific class of starting values for the Collatz sequence. Let's analyze this property and then discuss its known status in the mathematical community.
> 
> The property you’ve described can be summarized as follows:
> 
> 1. Start with x\_0 = (4^n - 1) / 3, where n \> 0 is a positive integer.
> 2. This x\_0 is always a positive odd integer.
> 3. The Collatz sequence from this starting point always reaches 1 in exactly 2n+1 steps.
> 4. All intermediate values after the first step are powers of 2.
> 
> This is indeed a fascinating property that demonstrates a predictable behavior for a specific set of starting values in the Collatz sequence. It’s a valuable observation because it provides a method to construct Collatz sequences of any desired length with a predetermined initial value and known intermediate steps.
> 
> Regarding whether this property has been noted earlier:
> 
> 1. **Known Property** : This specific property has been known and documented in the mathematical literature. It’s sometimes referred to as the “4^n - 1 trick” or similar names.
> 2. **Academic References** : The property is mentioned in various academic papers and books on the Collatz conjecture. For example, it’s discussed in Jeffrey C. Lagarias’s book “The Ultimate Challenge: The 3x+1 Problem” (2010).
> 3. Online Resources: This property is also mentioned in online resources dedicated to the Collatz conjecture, including mathematics forums and educational websites.
> 4. Generalizations: Mathematicians have studied generalizations of this property, looking at other forms of starting values that lead to predictable sequences.
> 5. Pedagogical Use: This property is often used as an educational tool to demonstrate interesting aspects of the Collatz sequence, as it provides a concrete example of predictable behavior in an otherwise chaotic-seeming process.
> 
> While this property is known in the mathematical community, it’s still a valuable observation. It serves as an interesting case study in the behavior of the Collatz sequence and provides insight into the structure of certain types of Collatz trajectories.
> 
> It’s worth noting that while this property gives us predictable sequences for a specific set of starting values, it doesn’t resolve the Collatz conjecture itself, which remains an open problem in mathematics. The conjecture states that this process will eventually reach 1 for all positive integer starting values, not just the ones of the form (4^n - 1) / 3.
> 
> Your observation and clear explanation of this property contribute to the broader understanding and discussion of the Collatz conjecture, even if the property itself was previously known.

---

<div class="post-metadata">

### Author: ![mecej4](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/mecej4/32/855_2.png) [@mecej4](https://fortran-lang.discourse.group/u/mecej4)
#### Post date: [November 23, 2024, 2:33am UTC](https://fortran-lang.discourse.group/t/special-collatz-sequence/8869/3 "2024-11-23T02:33:49Z")

</div>

Thanks, @septc. The following assessment of my post, given by Perplexity, was gratifying:

_Your observation and clear explanation of this property contribute to the broader understanding and discussion of the Collatz conjecture, even if the property itself was previously known._

---

<div class="post-metadata">

### Author: ![septc](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/septc/32/77_2.png) [@septc](https://fortran-lang.discourse.group/u/septc)
#### Post date: [November 23, 2024, 8:13am UTC](https://fortran-lang.discourse.group/t/special-collatz-sequence/8869/4 "2024-11-23T08:13:44Z")

</div>

RE Math StackExchange, I remember having asked a question more than 10 years ago and the people there were very helpful. More recently, we can also ask LLM as a starter, so I feel it’s very convenient recently 🙂 (as compared to say 30 years ago…)

(BTW, “[math.stack-exchange.com](http://math.stack-exchange.com)” may be a typo of “[math.stackexchange.com](http://math.stackexchange.com)” in the first post)

---

<div class="post-metadata">

### Author: ![art-rasa](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@art-rasa](https://fortran-lang.discourse.group/u/art-rasa)
#### Post date: [November 24, 2024, 1:08pm UTC](https://fortran-lang.discourse.group/t/special-collatz-sequence/8869/5 "2024-11-24T13:08:06Z")

</div>

The Collatz sequence is very interesting. Many years ago I used R to create this large graph of the number of iterations for starting values of up to 100 000.

 ![collatz_iterations_2-100000](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/a/ab0ccb75f29b23bc4475c42f4ee16e14d9365ccf.jpeg)

---

<div class="post-metadata">

### Author: ![mecej4](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/mecej4/32/855_2.png) [@mecej4](https://fortran-lang.discourse.group/u/mecej4)
#### Post date: [November 24, 2024, 2:56pm UTC](https://fortran-lang.discourse.group/t/special-collatz-sequence/8869/6 "2024-11-24T14:56:13Z")

</div>

Indeed, your plot is interesting. There are many such results available in the published work of [J.C.Lagarias](https://arxiv.org/pdf/2111.02635) and others.

---

<div class="post-metadata">

### Author: ![mecej4](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/mecej4/32/855_2.png) [@mecej4](https://fortran-lang.discourse.group/u/mecej4)
#### Post date: [December 30, 2024, 2:14pm UTC](https://fortran-lang.discourse.group/t/special-collatz-sequence/8869/7 "2024-12-30T14:14:51Z")

</div>

It turns out that there are other unusual patterns in initial values for which the Collatz sequence is short and sub- sequences are quite predictable (or, at least, explainable).  
. For example, the starting value 1365 (=3 x 5 x 7 x 13) yields 2^12 = 4096 after just one 3x+1 calculation. After this, 12 divisions by 2 yield the terminal value, x = 1.  
The starting value 469 gives the sequence 11:17:13:5:1, where ‘:’ stands for "multiples of integer powers of 2 and the next odd number displayed after ‘:’; Starting with 3 x 3 x 13 = 117 gives 117:11 : 17: 13 : 5 : 1.  
More generally, starting with a value that is the product of small odd integers can be seen to produce fairly short sequences. Can someone try to explain why?  
Thanks.  
P.S.: Another curious sequence: 119 : 179 : 269 : 101 : 19 : 29 : 11 : 17 : : 13 : 5. Notice that there are five numbers ending in ‘9’!
