Recaman_seq - Recaman-sequence-function. This function calculates the N first numbers (decorative plot optional) of the Recaman sequence. (https://oeis.org/A005132, https://en.wikipedia.org/wiki/Recam%C3%A1n%27s_sequence), the Recaman sequence is irregular, where the length of the step from one element to the next increases by one, the step-direction is down if the landing-point is not yet part of the sequence, otherwise up. It is not known if every natural number is part of the sequence.
If the cmlines-function (from the FEX-contribution:COLORMAP and COLORBAR utilities ) is available the plot becomes prettier.
Bjorn Gustavsson (2021). Recaman_seq (https://www.mathworks.com/matlabcentral/fileexchange/82179-recaman_seq), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!