Collatz’s Ant
gbragafibra.github.io
gbragafibra.github.io
[1]: natureofcode.com
Hints at deep stuff between the two simplest prime divisors of integers: 2 and 3, you have this iterated function that branches based on divisibility by 2 and changes proportional to 3. The addition of plus one really throws a spanner in the works, ensuring it's no longer divisible by 3, but whether it's divisible by 2 or not after the addition seems almost 50-50.
So cool - one day we will unravel all these patterns, see the higher order of which these are simpler cases glimpsed partially and it will all make sense! :)
Are you sure you said what you mean? If `n` (is an integer that) is not divisible by 2, then `3n + 1` always is. Maybe you were thinking of the model that incorporates this by replacing the iteration formula for `n` odd with `(3n + 1)/2`?
I guess it's the n/2 one whose divisibility by 2 becomes uncertain. I think I looked at the formula and thought 3n+ 1 if 3n + 1 ~ 1 (mod 2), not 'if n ~ 1' haha that was funny! :)
Thanks again :)
edit: Also what a lovely way to correct someone -- 'said what you mean' -- I am gonna use that! :)
Always interesting to try to visualize something though.
Ps -- I implemented hashlife one time. Still amazed someone came up with that algorithm
Long and/or large excursions can happen even for small n! As mentioned at https://en.wikipedia.org/wiki/Collatz_conjecture#Empirical_d... , for example, 27 meanders for quite a while before reaching the inevitable cycle.