The Collatz Conjecture. Mathematics Is Deceiving at Times. by Arpita Bhattacharya Medium
The Collatz Conjecture. Mathematics Is Deceiving at Times. by Arpita Bhattacharya Medium
The Collatz Conjecture. Mathematics Is Deceiving at Times. by Arpita Bhattacharya Medium
Say, n = 5.
5 → 16 → 8 → 4 → 2 → 1.
14 → 7 → 22 → 11 → 34 → 17 → 52 → 26 → 13
→ 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1.
Python code:
def collatz(n):
while n > 1:
if (n % 2):
# n is odd
n = 3*n + 1
else:
# n is even
n = n//2
print(1, end='')
n = int(input('Enter n: '))
collatz(n)
-3 → -8 → -4 → -2 → -1 → -2 → -1 → -2 → -1…..
Mathematics Math
37 1
Follow
Arpita Bhattacharya
Legendre’s Formula: A
Mathematical Breakthrough
Area of Math: Number Theory.
Arpita Bhattacharya
Arpita Bhattacharya
Dec 8, 2022 12 1
Arpita Bhattacharya