My hunt for a Collatz cycle
28 Mar 2026
The Collatz conjecture is a famous and infamous conjecture regarding the sequence generated by:
The conjecture states that for all positive integer values of , the sequence will always end in the trivial cycle. As example, the sequence for is:
All tested values up to end with this cycle. But so far it is unknown if there are any non-trivial cycles and if some value of flies off to infinity.
When starting this, I nurtured no expectations of doing anything meaningful. But I played around with math, got a better understanding of the conjecture, some of the related problems and learned something new.
Generalizing Collatz sequences
Instead of finding cycles for the classic Collatz conjecture, one can abstract a bit to find cycles in the Collatz-like sequences generated by:
Where is an odd number greater than or equal to . For , we have the normal Collatz sequence.
For , at least two cycles are known: and .
The addend can also be generalized to get:
Where and are odd integers, , .
This generalization makes cycles even more common. Two examples:
- : Produces a cycle of length 13
- : Produces a cycle of length 7
Here is a calculator to play around with cycles:
Algebraic form
Despite Collatz sequences being defined recursively, it’s easy to write a sequence out using common algebra. The cycle generated with , for can be written out as:
Using gives:
And thus we have a non-trivial cycle that takes steps up and steps down.
Writing out any Collatz-like sequence will provide a function of the form:
is the number of steps up that the sequence takes, and is the number of steps down.
The value of is determined by the actual steps in the sequence and the addend, .
For any cycles to happen, we must have the case that
This formula is interesting because it gives a relationship between ups and downs a sequence has, and the value of :
Solving for :
Again, considering , and from before, this is:
A different number in the cycle is , for which :
Consider the fact that isn’t much greater than , indeed it is only bigger by .
Speaking purely from a divisibility standpoint, it’s not hard to find integers divisible by . So it makes sense to look for values near roots of powers of as that will produce a small difference with the closest, smaller, odd power.
The number . Indeed, . It so happens that generates two -step cycles:
- :
- :
Making the same observation for : . , and this time resulting in a cycle.
Again, it’s easy to find numbers divisible by , and so the set of possible ’s is big. Looking for -values near roots of definitely makes sense.
Ramanujan–Nagell
At this point, I came across the Ramanujan–Nagell equation, which asks to find solutions for:
And states that the only solutions are:
For Ramanujan-Nagell, it is only for that we will have four solutions. All other positive integers beside will have at most two solutions. In general, according to Wikipedia, equations of my form will always have a finite number of solutions. This is a shame, because it would have been a very convenient shortcut to finding probable cycles by simply finding more cases where .
Expanding on the algebraic form
For now, cycles will not be the focus. I will instead explore the algebraic form more.
Recall that algebraic form is just writing out the steps done for some .
For some and , a sequence could be generated by:
Expanding gives:
An alternative notation could be: UDUDUDDDDDDDD, denoting Up or Down.
Since I started with an odd number, the sequence must start with an up step. As the number will now be even, the second step must be down. The next step up, however, did not have to happen right away, it could also have happened later.
Some observations:
- The up-down notation reveals this to be a combinatorics-like problem. For the working example of length 14 with three up steps and 11 down steps, the number of possible k’s will be bounded by the binomial coefficient.
- Completely disregarding the term, the expanded form will always be of the form
The term can be discarded since we use that for finding the value of as deduced earlier. What we are really asking is to find any situation there exists a set of integer solutions for the values such that the above sum is divisible by the difference of exponentials. - The addend is in every term except
- If the first step is up, then there is a limited set of potential values: They must all be odd, and the different values will be limited by the number of up steps not yet used.
Cycles with > 1
In the previous section, I deduced a general form that takes different values and different values into account. Here is a sequence where I have set :
For , this will cycle, as previously noted.
In this example, we have , and will always be divisible by the addend, . Remember to get a cycle, it must be that:
Here one can actually simplify quite a bit and make it more probable to get a cycle by picking a value of such that . We can even pick and that makes it much easier to find any cycles. This is exactly what happened with , where I picked .
Here is a setup for more, less trivial cycles:
This combination will produce cycles for e.g. , and many more. is a prime number, so unsurprisingly, values of do not produce cycles.
Another combination is:
Pick a value of such that . I will pick and am quickly able to find cycles for and .
Using this technique, I found these impressive looking 83-cycles:
:
- 7245921240921113361
- 8406686519753256401
- 7130232088932726865
- … and many more
This was produced by
Finding cycles for 3n + a
There is a different generalization of the Collatz sequence that asks to find cycles generated by , where and . Let me first try for . That means solving:
A solution to this is , and , giving .
With this knowledge, I find the following values generating cycles:
- 751
- 775
- 967
- 1399
- … and 32 more
Cycles when addend is 1
I now cycle back to the original problem after having explored variations of Collatz sequences.
After having run a good deal of brute forcing and finding numerous cycles with addend > 1, I have yet to find any examples, aside from and , where .
That’s annoying. But it also leads to possibly the most interesting graph in this post. Below is a plot of on the x-axis, and on the y-axis for the biggest odd, perfect power less than , plotted for each power in different colours.
There is an obvious trend that 2nd roots are closer to than 3rd roots, 3rd roots are closer than 4th roots, and so on. Since the y-axis has logarithmic values, the difference between and looks to be exponentially increasing.
Thoughts on the Collatz conjecture
Coming from the angle of what I did so far, I have been brute-forcing for values of and such that the binomial coefficient is high compared to the difference between the power of 2 and nearest, odd, perfect power:
Is high.
The binomial coefficient increases polynomially. Unfortunately, it looks like the denominator in above equation grows exponentially.
In the plot below, for any , I picked the closest, smaller power of three. E.g., for , I used since that would minimize the difference between the terms. On the y-axis is the log 10 of the difference between the powers:

One can see some outliers from the general trend. For example, at , where . Numerically that’s pretty close, but working with exponentials, amounts to a very big difference, roughly .
and so the relevant binomial is still very small in comparison.
If, somewhere far out there, there is a case where , that would be a good option to try out.
I have found thousands of cycles in Collatz-like sequences, including the form with , which is not that different from , on the surface. At first glance, (with ) produces a cycle, then why would such one not exist for ? Allowing negative addends, the sequence with produces a cycle as well.
On the other hand, for relevant , , and ’s, I only know of two examples such that , where is indeed . This would speak against that, and I have looked a lot.
Looking at the graph where the differences for bigger roots tended to be greater than square roots also speaks for the conjecture. If the multiplier, , is , it would have to be an enormously big root in play, and judging from the indications of the plots presented, that will give a very big difference and we will never have .
I lean towards the conjecture being true. Maybe we’ll know some day.
Anyways, I have been playing around with this problem for a while now and learned something, so project well done. I will be putting down the Collatz conjecture for now.