I was watching a video about the Collatz Conjecture on YouTube: https://www.youtube.com/watch?v=094y1Z2wpJg
I found it pretty interesting and wanted to replicate it into Snap!. I would have done this in Python or some other language in REPL but Python in REPL has surprisingly smaller number limits than Snap! and if I go higher, REPL displays a message in the console that the "signal was killed" or something. Anyways. Here's the link (hopefully, I'll be adding a graph to show each number's pattern soon.): Collatz Conjecture
The way this algorithm works (if you're too lazy to watch the video which I get.), is that you have a random number. Say you pick 10. If this number is even, which it is, then you divide by 2. Else, you multiply by 3, then add 1. So in this case, it would go like this: 10, 5, 16, 8, 4, 2, 1, 4, 2, 1, 4, 2,1
. As you can see, this 4, 2, 1
loop continues on and on and on.
Another example. let's say we start with 2541. Here is how it would go.2541, 7624, 3812, 1906, 953, 2860, 1430, 715, 2146, 1073, 3220, 1610, 805, 2416, 1208, 604, 302, 151, 454, 227, 682, 341, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1
. Yet again, we're in this 4, 2, 1
loop.
The unsolved part is: does this 4, 2, 1
loop apply to every number all the way up to infinity? The most anyone's ever gone to is 2^68. Around 300 quintillion.