Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Get the Collatz sequence starting with a given value
ResourceFunction["Collatz"][n] gives the Collatz sequence starting with n. | |
ResourceFunction["Collatz"][n,m] gives the first m iterations. |
Collatz sequence for 13:
In[1]:= | ![]() |
Out[1]= | ![]() |
Show just the first 30 iterates for 27:
In[2]:= | ![]() |
Out[2]= | ![]() |
Highlight odd values:
In[3]:= | ![]() |
Out[3]= | ![]() |
Plot all the iterates for 27:
In[4]:= | ![]() |
Out[4]= | ![]() |
Plot the number of iterates needed for the first 100 integers:
In[5]:= | ![]() |
Out[5]= | ![]() |
Number of iterates needed for the first 2000 integers:
In[6]:= | ![]() |
Out[6]= | ![]() |
Paths of the iterates for the first 100 integers:
In[7]:= | ![]() |
Out[7]= | ![]() |
Graph of the iterates for the first 26 integers:
In[8]:= | ![]() |
Out[8]= | ![]() |
Graph of the iterates for 500:
In[9]:= | ![]() |
Out[9]= | ![]() |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License