This site requires JavaScript, please enable it in your browser!
Greenfoot back

Comments for Collatz Calculator

Return to Collatz Calculator

A new version of this scenario was uploaded on 2018-04-12 21:39:03 UTC
If you find any interesting numbers leave them here: for example, 47 has a lot of steps
danpostdanpost

2018/4/12

Your 47 takes 104 steps. Interestingly enough, the number 107 takes exactly 100 steps. However, 97 takes a whopping 118 steps.
danpostdanpost

2018/4/12

And 463 takes 128 steps, reaching as high as 9232 before coming down. The number 73 goes up to the same height, taking 115 steps. In fact, the others I had mentions (47, 97 and 107) all reach a maximum of 9232 -- curious.
@danpost the video in the description explains why. Two numbers steps may end up at the same result. for instance if you start at 10 you will get 10 -> 5 -> 16 -> 8 - > 4 -> 2 -> 1, and if you start at 21 you will get 21 -> 64 -> 32 -> 16 -> 8... and so on. Heres a small example: https://occupymath.files.wordpress.com/2017/04/collatz.png?w=700
You'll notice all of those numbers steps contain 107 as the first common number, so everything after 107 is all the same, and with that, you can take and number and, say you wanted to get 50 steps, find the (nSteps - 50)th number up there.
danpostdanpost

2018/4/12

I can understand numbers closer to one being more commonly reached. However, a common high maximum for quite a few relatively small numbers was a bit surprising.
1073741824 has 30 steps. (2^x has x steps)
danpostdanpost

2018/4/12

I guess it makes sense the the ones that take many steps would end up on along similar numbers as the many shorter paths take up most the other numbers.
A new version of this scenario was uploaded on 2018-04-13 13:16:01 UTC Cleaned up code and added what I believe documentation is
A new version of this scenario was uploaded on 2018-04-13 23:48:47 UTC html 5 compatibility since i made the previous changes on an outdates greenfoot version
A new version of this scenario was uploaded on 2018-04-13 23:52:23 UTC what good is documentation of the sourse isnt availible?
A new version of this scenario was uploaded on 2019-01-21 03:16:32 UTC prints steps live.