let memo = {}
function conjecture(n) {
let str = "";
while (n !== 1) {
str += n + " ";
if (memo[n] != null) {
str += "->";
return str;
} else {
if (n % 2 === 0) n = memo[n] = n / 2;
else n = memo[n] = n * 3 + 1;
}
}
str += n + " ";
return str;
}
function rangeTo(end) {
return new Array(end).fill(null).map((_, i) => i + 1)
}
for (const n of rangeTo(1000)) {
console.log(conjecture(n))
}
A neat thing is that this terminates (at 1) for seemingly every number you try (I disabled console-logs and the process terminated for every number up to a range of 10,000,000, which is as high as I tested). It's just the formal proof that missing. There also seems to be a vague pattern to the results, but that may just be cloud-pictures.Other people have taken this experiment a bit further already:
https://en.wikipedia.org/wiki/Collatz_conjecture#Experimenta...
> As of 2020, the conjecture has been checked by computer for all starting values up to 2⁶⁸.
That's the only thing that actually matters. You've demonstrated something analogous to the following: "Claim: there are no numbers larger than 100,000,000,000,000,000." You've then gone and checked all the numbers from 1 to 10 million, concluded that it's true, and then just say that we're missing a formal proof. I don't mean to be rude, but from an actual mathematical point of view, you've basically demonstrated nothing.
10 million is mindboggling tiny when it comes to all the numbers. Consider this counterexample to Polya's conjecture: https://www.youtube.com/watch?v=eQCUPQdi6DY
Or so many other examples: https://math.stackexchange.com/questions/514/conjectures-tha...
Well that's how it comes off. Obviously I didn't think I'd made some breakthrough in five minutes with some JavaScript, and obviously I know that the formal proof is the important thing. I was just poking at the phenomenon and expressing my curiosity. There's no need to be so eager to jump in and shut that down.
As well as the rest of the numbers between ten million and infinity.
And I suppose, an understanding of why.
"... It also has a very interesting property as an adjective, and that is it's impossible to use the word dynamic in a pejorative sense. Try thinking of some combination that will possibly give it a pejorative meaning. It's impossible. Thus, I thought dynamic programming was a good name. It was something not even a Congressman could object to. So I used it as an umbrella for my activities." https://en.wikipedia.org/wiki/Dynamic_programming#History
Also, by the way, to the extent that "dynamic programming" has a definition (the words have little to do with what it means, so it's hard to fix the term to a specific definition), it generally refers to a superset of memoization. So memoization is the more specific term, and should be preferred.
I think we may be able to help kill usage of the term by observing that its initialization, DP, which some people are fond of using, has a much more graphic alternate meaning. Then modern puritanism may make people reluctant to say it anymore.
Yup, quickly it gets to the role of prime numbers or a product of primes and some number of factors of 2.
Heck, obviously can draw a directed graph with an arc from each odd number, that is, a product of primes except 2, and the result of the 3X + 1 operation. Then have an arc from each even number to that number with one less factor of 2.
Then if could argue that given a number n, the nodes in the graph that can be reached from n are finite and if we don't enter cycles without a 1, then we are done!
Alas, as one might expect from all the effort on this problem, a gap here is the argument of finiteness, and that quickly gets to how many primes there are or are not! And as we know, where all the primes are is a tough problem.
Long ago in math, I decided not to spend effort on big questions about prime numbers!
So, I gave up, decided to use easier problems to think about when going to sleep!
I know that many mathematical problems are more about "charting the terrain" and don't have a particular use until long after they're discovered. But this one seems especially arbitrary; almost like a brain-teaser. And given the funding involved, I have to wonder if there's some usecase that's already known- even if that usecase is just for other high-level math.
Edit: I found this https://math.stackexchange.com/questions/2694/what-is-the-im...
Sounds like it has something to do with the predictability of primes, which has obvious importance