I want to create a Recaman sequence where there is a "1" in the n-th position. So from which integer should I start the Recaman sequence? If there are more than one starting integer that generates a sequence with a 1 in the n-th position, return the lowest one.
For example if I want to place the digit 1 in the 7th place in the sequence then I should start the sequence from six as follow;
seq = [6 5 3 6 2 7 1 8 16]
You can also start the sequence with 12 and obtain a series where there is a 1 in 7th position;
seq = [12 11 9 6 2 7 1]
Related Challenges :
  1. Recaman Sequence - I
  2. Recaman Sequence - II
  3. Recaman Sequence - III

Solution Stats

241 Solutions

88 Solvers

Last Solution submitted on Feb 03, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Group


Problem Recent Solvers88

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!