File Exchange

image thumbnail

Collatz Conjecture

version (1.55 KB) by Reza Ahmadzadeh
Test the Collatz Conjecture (a.k.a 3x+1 conjecture)


Updated 08 Aug 2016

View License

The conjecture can be summarized as follows. Take any positive integer n. If n is even, divide it by 2 to get n / 2. If n is odd, multiply it by 3 and add 1 to obtain 3n + 1. Repeat the process (which has been called "Half Or Triple Plus One", or HOTPO) indefinitely. The conjecture is that no matter what number you start with, you will always eventually reach 1.

Comments and Ratings (1)

MATLAB Release Compatibility
Created with R2008a
Compatible with any release
Platform Compatibility
Windows macOS Linux