a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment by mike
mike  ·  2629 days ago  ·  link  ·    ·  parent  ·  post: Collatz conjecture

I've "wasted" happy hours with this.

Wrote a post about it when I was writing a blog for the Norwegian national math education center:

http://www.matematikksenteret.no/content/2159/Collatz-formodning-The-Collatz-Conjecture

I'm re-inspired by those pics! Gonna fire up Processing now and play... maybe find a new way to visualize, maybe just find a new way to lose a few hours...





veen  ·  2629 days ago  ·  link  ·  

Is there a graph version with the number on one axis and the number of steps until 1 on the other axis? Or would that look just unintelligible?

wasoxygen  ·  2629 days ago  ·  link  ·  
veen  ·  2629 days ago  ·  link  ·  

That second graph is so cool! I decided to make my own real quick:

    import numpy, matplotlib.pyplot

matrix = numpy.zeros(10000)

for i in range(1, 10000):

counter = 0

pos = i

while pos != 1:

if pos % 2 == 0:

pos = pos / 2

counter = 1

else:

pos = pos*3 1

counter += 1

matrix[i] = counter

print(i, counter)

matplotlib.pyplot.figure(figsize = (20,10))

matplotlib.pyplot.scatter(range(1, 10000), matrix[1:10000], s=1)

(Gotta love Python eh!)