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 :