Collatz sequence

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

You are now following this Submission

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://ch.mathworks.com/matlabcentral/fileexchange/78691-collatz-sequence), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0