Collatz sequence
Version 1.0.0 (2.33 KB) by
Dhruv Shah
In the collatz sequence, if the maximum of a certain subset is taken (e.g. for every 10 terms), those maxima too show a similar pattern
The code takes three inputs:
Number of data points to plot, the step, and a bin width.
The step enables us to make the plot look more or less crowded; higher step size does mean higher runtime of code.
Bin width is present essentially to highlight the highest points in the output plot
Cite As
Dhruv Shah (2026). Collatz sequence (https://in.mathworks.com/matlabcentral/fileexchange/78691-collatz-sequence), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2020a
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0 |
