Collatz Conjecture Algorithm

1.2k Views Asked by At

Related: A general question about the Collatz Conjecture and finding that integer that doesn't work

I was coding a solution to the $3k+1$ problem and was looking at ways to speed up the computation. In the related question, it is noted that the first counterexample should be an odd number, and I have adjusted my code to only search the odd numbers, immediately disregarding the evens.

Is it valid to stop computing a trajectory once the current value has dropped below the starting point?

3

There are 3 best solutions below

6
On BEST ANSWER

I did some "independent and unpaid research" on this (much against all advice an undergrad student in mathematics receives regarding this particular problem) and arrived at the following:

The Collatz conjecture is true if and only if all positive integers of the forms $4r+3$ or $8r+3$, $r$ being odd, eventually reach lower values by iterating the Collatz function.

So indeed, you may restrict your attention to odd numbers, specifically to those of the form I just mentioned, and drop the computations when they reach lower values.

(My analysis can be pushed even further to filter away more odd numbers that will reach lower points, but I saw no clear pattern in my analysis, hence paused working on it)

A short version of my proof of the above statement: We just show that all other positive integers eventually reach lower values. For even numbers this is clear. For odd numbers, write them in the form $2^kn+1$, $n$ odd and $k>0$. Iterate the Collatz function. For even exponents $k$, 3 iterations will be enough (details left to the reader). For odd exponents other than 1, 3 iterations will again suffice. Thus the conjecture is true iff all positive integers of the form $2n+1$, $n$ odd, reach lower values.

Now, substitute $n$ by $2^xy+1$, $y$ odd and $x>1$, repeat the above analysis.

As for what happens with $4r+3$ and $8r+3$, $r$ odd…I realized that I probably wouldn't be able to finish any kind of proof with this, but that I could go on forever with these substitutions…

Also, as all others have said, please make sure that all integers less than those that you consider have already been verified, otherwise you might fool yourself (even though I feel it wouldn't matter in the long run, but it could cause some delays in finding the truth in those scenarios…).

0
On

If you are looking for the minimal counterexample, then you could stop as soon as the trajectory reached a number less than itself; since every element in the trajectory of a counterexample is also a counterexample.

However, this should not be confused with, "If the trajectory of $x$ contains $y \lt x$, $x$ is not a counterexample", it is only true that "If the trajectory of $x$ contains $y \lt x$, $x$ is not the minimal counterexample".

0
On

Is it valid to stop computing a trajectory once the current value has dropped below the starting point?

Well, your question is impossible to answer, since at present, there is no known starting value which doesn't eventually converge to the circular trajectory of $[4,2,1]$.

So let's say I give you a counterexample where you cannot stop computing a trajectory once the current value has dropped below the starting point: $[41,124,62,31]$.

This trajectory is known to converge after $110$ steps ($40$ steps through odd numbers).

If you don't know this fact, then my example is good enough to tell you that you cannot stop computing the trajectory once the current value has dropped below the starting point.

If you do know this fact, then you can indeed stop computing the trajectory once the current value has dropped below the starting point.

But if you already know this fact, then you may as well stop computing the trajectory right away.