Cody

Problem 44340. Recaman Sequence - III

Created by Mehmet OZC in Community

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

48.21% Correct | 51.79% Incorrect
Last solution submitted on May 23, 2019

Problem Comments