Posts

Showing posts with the label math

Collatz Conjecture - a mathematical mystery ( with Python )

Image
            Yes, Nature loves symmetry. Though man discovered mathematics to solve real life and abstract problems, the Nature also obeys some mathematical rules. And sometimes, we all come to a very strange understanding seeing the unsolved mysteries of mathematics. One of that mysteries is the Collatz Conjecture or the 3n+1 conjecture .      This is nothing but a very simple procedure which we can apply to any number. But the fact all the numbers tested on this procedure come to the same output result. Let's say, we have a number N .  If it is odd then multiply it by 3 and add 1, meaning 3N+1 . And if it's even then divide it by two or calculate N/2 . And follow this steps again and again.     let's take any number 19. Odd number so 3*19+1 = 58. It is even so calculate 58/2 = 29. Now odd 3*29+1 = 88 and so on... 88 /2 =  44                   44 /2 =  22 22 /2 =  11                   3 * 11 +1 =  34 34 /2 =  17                  3 * 17 +1 =  52 52 /2 =  26