Implementing 3x+1 or Collatz Conjecture In Pythonby@h3avren
13,225 reads

Implementing 3x+1 or Collatz Conjecture In Python

tldt arrow
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

The Collatz Conjecture has two simple rules to be followed indefinitely: Take a number and check if it’s even or odd 2. If it's even divide it with two else multiply it with 3 and add 1 to the result. When performed with any number indefinitely, at some point the result is reduced to 1. This is contradictory given we are just halving the number when it is even whereas adding 1 after tripling it if it's found to be odd. The number should increase but instead, no matter how big or small a number is it gets reduced.

Company Mentioned

Mention Thumbnail
featured image - Implementing 3x+1 or Collatz Conjecture In Python
Ajay Singh Rana HackerNoon profile picture

@h3avren

Ajay Singh Rana

Dreaming with Python... Under a sky in India...


Receive Stories from @h3avren

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!