File Exchange

image thumbnail


version 1.0.1 (20.9 KB) by Edgar Guevara
Checks for the Collatz conjecture for a given number

1 Download

Updated 16 Dec 2019

GitHub view license on GitHub

This function checks for the Collatz conjecture for a given number.
It can be customized to check other variants different to 3n+1
Takes a number n. If it’s even, divide by 2. If it’s odd, multiply by 3 and add 1. Repeat. Do all starting numbers lead to 1?

Cite As

Edgar Guevara (2020). collatz (, GitHub. Retrieved .

Comments and Ratings (0)



updated logo

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