News for hackers. Stuff that matters.
Re:Collatz's Ant by gregschlom on Wednesday April 23, 2025 @11:59AM (#43773605)
You lost me here: "visualize it by just looking at the even and odd steps like so: 5->10"

Where does the 10 come from?

Re:Collatz's Ant by skulk on Wednesday April 23, 2025 @12:01PM (#43773617)
5 is odd, so that's where the 1 comes from

8 ((5*3+1)/2) is even, so that's where the 0 comes from

4 (8/2) is the end.

Re:Collatz's Ant by lapetitejort on Wednesday April 23, 2025 @01:21PM (#43774432)
That is correct. I use pseudo-binary to represent the steps the number takes. Simply counting the number of steps is enough to get n, as all steps will have an implicit or explicit even step.