The 3n+1 Problem | Learn Collatz Conjecture

Join Trial or Access Free Resources

The 3n+1 Problem is known as Collatz Conjecture.

Consider the following operation on an arbitrary positive integer:

  • If the number is even, divide it by two.
  • If the number is odd, triple it and add one.

The conjecture is that no matter what value of the starting number, the sequence will always reach 1.

Observe that once it reaches 1, it will do like the following oscillation

1 -> 4 -> 2 -> 1-.> 4 ->2 ....

So, we see when it converges to 1, or does it?

We will investigate the problem in certain details as much as possible with occasional exercises and some computer problems ( python ).

Let's start!

Let's start by playing with some numbers and observe what is happening actually.

We will need this frequently. So let's make a little piece of code to do this.

n = 12
print(n)
while n > 1:
    if n % 2 == 0 :
        n = n//2
        print (n)
    else:
        n = 3*n+1
        print (n)

This will give the output :

12 6 3 10 5 16 8 4 2 1

Now depending on the input of "n" you can get different sequences.

Exercise: Please copy this code and changing the input value of "n", play around with the sequences here. (Warning: Change it to python before implementing the code.) Eg: Do it for 7.

3n+1 Problem - sequence

If you observe that different numbers requires different time to converge and that is the unpredictable which makes the problem so hard.

There are in total two possibilities:

  • It may occur a particular value occurs repeatedly i.e. after some time the sequence starts repeating. We define the last non-repeating digit to be the Terminating Number. The total number of numbers in the sequence until the terminating number is called the Length of the Sequence. For eg: For 5 the Terminating Number is 1 and the Length of the sequence is 6.
  • We may never end the sequence. In that case, the sequence never terminates.

Exercise: Find out the length of the sequence for all the numbers from 1 to 100 by a computer program. I will provide you the code. Your job is to find a pattern among the numbers.

c = 1
for n in range(2,101):
    i = n 
    while i > 1:
        if (i % 2 == 0):
            i = i//2
            c = c + 1
            if i == 1 :
                print( "The length of the sequence of {} is {}".format(n, c) )
                c = 1
        else:
            i = 3*i+1
            c = c + 1 

Exercise: Consider the length of a sequence corresponding to a starting number "n' as L(n). Consider numbers of the form n = (8k+4) and n+1 = (8k+5), then find the relationship between L(n) and L(n+1). Try to observe the sequence of lengths for the numbers till 100 and predict the conjecture..

Exercise: Prove the conjecture that you discovered.

Hint:

8k+4 -> 2k+1 -> 6k+4 -> 3k+2

8k+5 -> 24k+ 16 -> 3k+2

Exercise: Prove that if n = 128k + 28, then L(n) = L(n+1) =L(n+2)

Hint:

128k+28 -> 48k+11 -> 81k+20

128k+29 -> 48k+11 -> 81k+20

128k+30 -> 81k+20

Exercise: Try to generalize the result for general k consecutive elements. Maybe you can take help of the computer to observe the pattern. Modify the code as per your choice.


You can try to do an easier problem and get the intuition as an exercise.

Exercise: Try to understand the behavior and the terminating number of the sequence if the rule is the following:

Consider the following operation on an arbitrary positive integer:


1. If the number is even, divide it by two.
2. If the number is odd, add 1.


Exercise: Try to understand the behavior and the terminating number of the sequence if the rule is the following:
Consider the following operation on an arbitrary positive integer:

1. If the number is even, divide it by two.
2. If the number is odd, add any 3.


Exercise: Try to understand the behavior and the terminating number of the sequence if the rule is the following:
Consider the following operation on an arbitrary positive integer:

1. If the number is even, divide it by two.
2. If the number is odd, add ANY ODD NUMBER.

Eager to hear your approaches and ideas. Please mention them in the comments.

Other useful links:-

More Posts
A Major Milestone in Young Research: Aaditya Punatar and Muskan Sadana Publish in JEI

A Major Milestone in Young Research: Aaditya Punatar and Muskan Sadana Publish in JEI

October 11, 2026

Publishing original scientific research in a peer-reviewed journal is an achievement many scholars work toward for years. Achieving this feat early in one's academic journey requires exceptional intellectual rigor, creativity, and persistence. Aaditya Punatar and Muskan Sadana have reached this remarkable milestone, successfully publishing their collaborative research paper in the prestigious Journal of Emerging Investigators […]

Read More
Prishaa Shrimali Named Grand Finalist at Regeneron ISEF 2026 for Quantum-Powered Urban Planning Research

Prishaa Shrimali Named Grand Finalist at Regeneron ISEF 2026 for Quantum-Powered Urban Planning Research

October 6, 2026

Her project on quantum-accelerated Steiner trees for 15-minute cities earned a place among the finalists at the world's largest pre-college STEM competition. Prishaa Shrimali of Marymount School of New York, was selected as a Grand Finalist at the 2026 Regeneron International Science and Engineering Fair (ISEF) in Phoenix, Arizona. Her project was Optimizing Urban Accessibility: […]

Read More
ISI M.Stat Entrance Success Story 2026

ISI M.Stat Entrance Success Story 2026

June 27, 2026

In 2026, the following Cheenta students have been successful for Indian Statistical Institute's M.Stat Entrance. They ranked within the first 50 in the entire country in these entrances. I.S.I. M.Stat Entrance

Read More
ISI B.Stat-B.Math and CMI BSc. Math Entrance Success Story 2026

ISI B.Stat-B.Math and CMI BSc. Math Entrance Success Story 2026

In 2026, the following Cheenta students have been successful for Indian Statistical Institute's B.Stat Entrance and Chennai Mathematical Institute's B.Sc. Math Entrance. They ranked within the first 200 in the entire country in these entrances. Most of these students attended the problem solving workshops regularly, which happen 5 days every week. CMI B.Sc. Math Entrance […]

Read More

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2010 - 2025, Cheenta Academy. All rights reserved.
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram