The Collatz Conjecture is a deceptively simple problem in mathematics that has fascinated mathematicians, computer scientists, and enthusiasts for decades.
A famous unsolved problem in number theory that states any positive integer will eventually reach 1 when you repeatedly apply two simple arithmetic operations.
Proposed by Lothar Collatz in 1937, this conjecture starts with a basic question:
Take any positive integer. If it is even, divide it by 2; if it is odd, multiply it by 3 and add 1. Repeat the process. Will you always eventually reach 1?
Despite the simplicity of its formulation, the Collatz Conjecture remains unsolved to this day.
What is the Collatz Conjecture? (Formal Definition)
Collatz Conjecture also known as the 3n + 1 mapping involves the following rules for generating a sequence of integers:
Start with any positive integer n.
- If n is even, divide it by 2 to get the next term.
- If n is odd, multiply it by 3 and add 1 to get the next term.
- Repeat the process with the new value of n.
The conjecture states that no matter which positive integer you start with, the sequence will always reach 1.
While many mathematicians have studied the conjecture and believe it’s true, it has not been proven.
Origin and Popularity
Lothar Collatz introduced this sequence in 1937, and it has since been known by various names: the 3x + 1 problem, the Syracuse problem, and the Hailstone sequence (due to the sequence’s rise and fall resembling hailstones).
The conjecture caught the attention of prominent mathematicians such as Paul Erdős, who famously said, “Mathematics is not yet ready for such problems.” Its accessibility and the profound mystery surrounding it have made it a topic of widespread curiosity and computational exploration.
The Paradox of the Collatz Conjecture
One of the most puzzling aspects of this conjecture is that, despite its unresolved status, it has been computationally verified for an extraordinarily large range of numbers. As of current computational records, the conjecture holds true for all integers up to:
2^{68} ≈ 2.95 × 10^{20}
Despite this, no one has been able to formally prove that it will always reach 1 for every positive integer. This paradox—empirical verification without a theoretical proof—places the Collatz Conjecture among the most intriguing unsolved problems in mathematics.
No Formal Proof Yet: A Stubbornly Unsolved Problem
Even after nearly a century, no formal proof has been established for the Collatz Conjecture. Attempts have ranged from probabilistic models to complex number theory analyses, yet none have succeeded in providing a definitive resolution.
The difficulty lies in the seemingly chaotic behaviour of sequences generated by the Collatz function. While some numbers quickly converge to 1, others grow significantly large before finally descending—making patterns elusive and rigorous proof challenging.
Understanding Collatz Sequences
Several intriguing aspects of the Collatz Conjecture and the corresponding Collatz Sequences can be visualized using Python. Let us examine them through this code.
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import seaborn as sns
# Function to compute Collatz sequence length and max value reached
def collatz_steps_and_max(n):
steps = 0
max_val = n
while n != 1:
if n % 2 == 0:
n //= 2
else:
n = 3 * n + 1
max_val = max(max_val, n)
steps += 1
return steps, max_val
# Set range for analysis
N = 20 # Change N for larger analysis
numbers = np.arange(1, N + 1)
steps_list = []
max_values = []
# Compute steps and max values for each number in the range
for num in numbers:
steps, max_val = collatz_steps_and_max(num)
steps_list.append(steps)
max_values.append(max_val)
# 1. Histogram of Steps to Reach 1
plt.figure(figsize=(10, 5))
plt.hist(steps_list, bins=range(min(steps_list), max(steps_list) + 2), color='blue', alpha=0.7, edgecolor='black')
plt.xlabel("Number of Steps")
plt.ylabel("Frequency")
plt.title("Histogram of Steps to Reach 1 in Collatz Conjecture")
plt.xticks(range(min(steps_list), max(steps_list) + 1)) # Ensure integer ticks
plt.grid(False)
plt.show()
# 2. Heatmap of Steps to Reach 1
heatmap_data = np.array(steps_list).reshape(-1, 1)
plt.figure(figsize=(6, 7))
sns.heatmap(heatmap_data, cmap="coolwarm", cbar=True, annot=True, xticklabels=False, yticklabels=numbers, fmt="d")
plt.title("Collatz Steps Heatmap")
plt.ylabel("Starting Number")
plt.show()
# 3. Cycle Detection (Checking for non-trivial cycles)
G_cycles = nx.DiGraph()
for num in numbers:
n = num
while n != 1 and not G_cycles.has_edge(n, n):
next_n = n // 2 if n % 2 == 0 else 3 * n + 1
G_cycles.add_edge(n, next_n)
n = next_n
plt.figure(figsize=(10, 5))
nx.draw(G_cycles, with_labels=True, node_color="lightcoral", edge_color="black", node_size=400, font_size=8)
plt.title("Cycle Detection in Collatz Conjecture")
plt.show()
# 4. Growth Rate Analysis (Highest value reached vs. Starting number)
plt.figure(figsize=(10, 5))
scatter = plt.scatter(numbers, max_values, c=steps_list, cmap='plasma', alpha=0.75, edgecolor='black')
plt.xlabel("Starting Number")
plt.ylabel("Max Value Reached")
plt.title("Growth Rate Analysis in Collatz Conjecture")
plt.xticks(range(1, N + 1, max(1, N // 10))) # Ensure integer x values
plt.yticks(range(min(max_values), max(max_values) + 1, max(1, max(max_values) // 10))) # Ensure integer y values
plt.colorbar(scatter, label="Steps to Reach 1")
plt.grid(True)
plt.show()
Histogram of Steps to Reach 1
This plot illustrates the distribution of steps required for numbers within a range (1 to 20) to reach 1.

Notice the spread of values—how different starting numbers in the range reach 1
in considerably different number of steps.
Heatmap of Steps to Reach 1
This visualization presents a heatmap where color intensity reflects the number of steps needed to reach 1 for each starting value.
Patterns show how certain numbers require significantly more steps than their neighbouring numbers to reach 1.
Cycle Detection: Searching for Non-Trivial Cycles
Apart from the well-known trivial cycle (4 → 2 → 1), one might wonder if there exist non-trivial cycles. The plot below explores this by attempting to detect cycles beyond the trivial one.
No non-trivial cycles have been found yet, reaffirming the peculiar consistency of the conjecture.
Growth Rate Analysis: Highest Value Reached vs. Starting Number
This plot demonstrates how high sequences climb before eventually reaching 1.
Some starting values trigger sequences that reach astonishing heights before collapsing back down to 1. (Try 703 in above simulation.)
Similar Conjectures
The Collatz Conjecture isn’t the only famous unsolved problem with a simple formulation. Some other notable conjectures include:
Goldbach Conjecture (1742): Every even integer greater than 2 can be expressed as the sum of two prime numbers. Like the Collatz Conjecture, it remains unproven despite extensive numerical verification.
Twin Prime Conjecture: There are infinitely many pairs of prime numbers that differ by 2 (such as 11 and 13, 17 and 19). While progress has been made, a full proof remains elusive.
Catalan’s Conjecture (Proven in 2002): Originally a conjecture proposed in 1844, it stated that 8 and 9 are the only consecutive powers of natural numbers:
8 = 2^3, 9 = 3^2
Although it was proven by Preda Mihăilescu in 2002, it remained an open problem for over 150 years.
Collatz-Like Conjectures: There are variations of the Collatz Conjecture using different functions, such as the 5x + 1 problem or generalized Syracuse problems. These conjectures explore how changing the formula affects the sequence behaviour, and they often remain unresolved.
These conjectures share a common theme, simple statements with profound implications that resist formal proof despite centuries of mathematical effort.
The Collatz Conjecture continues to stand as a symbol of the limits of human understanding in mathematics. Its simplicity makes it accessible to anyone, yet its resolution has eluded even the greatest mathematical minds.
Through computational efforts, we can visualize and explore its behaviour, but the ultimate question remains unanswered:
Will a formal proof ever emerge, or will this conjecture remain a tantalizing mystery?
Until then, the Collatz Conjecture remains a beautiful illustration of how simplicity can give rise to profound complexity, inspiring curiosity, and wonder across the mathematical world.