Live data from Hacker News

A shower thought turned into a Collatz visualization

abstractnonsense.com

31–32 of 32 posts

Re: A shower thought turned into a Collatz visualization

#31
Here is a python script that plots on the Z axis - each number through an entire Collatz cycle until the result of 1, on the X axis - the number of cycles needed to get to 1, on the Y axis - add 1 for odd numbers, subtract 1 for even numbers. https://gist.github.com/bwanaaa/4c77b33311916b230c8b1891bab4...

You can open it in colab to visualize it. You can change the range of integers by modifying line 33 in the function def generate_all_sequences():

Interestingly, it seems there are more odd numbers than even ones in a collatz sequence as all graphs tend to the positive Y axis. All numbers tend to generate 3x as many odd results as even and they all seem to do this at this same rate.

In the first 750 integers, the number 703 reaches as high a collatz result as 250504.

Re: A shower thought turned into a Collatz visualization

#32
post #26
post #18

Talking about shower thoughts on Collatz visualizations.. A while ago I though of a way of structuring the collatz orbits by arranging integers in a 2d grid with odd numbers being arranged along the X axis and multiples of the power of two along the Y axis. https://gist.githubusercontent.com/ginkgo/13121db56b65b1237e... So essentially any odd number n and all numbers n * 2^m belong to the same group of numbers that e…

Just wanted to chime in and say that's a really interesting visualization of the conjecture, I haven't seen it before (and I have wasted more than a few hours on this problem).

try this visualization https://gist.github.com/bwanaaa/4c77b33311916b230c8b1891bab4... just open it in collar and the 3d graph appears
Post reply on HN