paint-brush
Implementing 3x+1 or Collatz Conjecture In Pythonby@h3avren
13,406 reads
13,406 reads

Implementing 3x+1 or Collatz Conjecture In Python

by Ajay Singh Rana3mJanuary 16th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

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
Ajay Singh Rana

Ajay Singh Rana

@h3avren

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

About @h3avren
LEARN MORE ABOUT @H3AVREN'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Ajay Singh Rana HackerNoon profile picture
Ajay Singh Rana@h3avren
Dreaming with Python... Under a sky in India...

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite