On the 3x+1 Problem: Basic algorithm speedups
The last time I talked about the 3x+1 Problem, I gave a basic overview of what it is. Today, I will talk about some (basic) ways to speed up the search for a counterexample, and next time I will introduce the Structure Theorem for the 3x+1 Problem. Part I : An introduction to 3x+1 Part II: Basic algorithm speedups (this one) Part III: The Structure Theorem I suggest reading from the beginning if you do not know what the 3x+1 (Collatz) Problem is. To get starting on thinking of some simple reasoning can do in speeding it up, here is some pseudocode of a naïve implementation of an algorithm that forever checks numbers. After it checks that a number goes to 1, it moves on to the next. repeat with x from 1 to forever set testMe to x while testMe is not 1 do if testMe is odd then set testMe to 3*testMe + 1 else -- It must be even set testMe to testMe divided by 2 end if end while end repeat Somewhat ironically, we wil...