# Rainbow Door Sequence

I have 7 doors coloured like the rainbow:

You can move in either direction moving one door for the first go, two for the second, three for the third, etc - you get the idea.

NOTE

You can jump to the other side. e.g. On your first go you can move from red to violet.

Start on red. Is it possible to go to each door, only going to each colour door no more than twice? (It is impossible to do it touching each one just once)

You must end up back on red

What is the sequence of movements which will result in success? (I am looking for the least amount of moves)

The current leader board, top 5:

1. Matt: 9
2. Oren Melzer: 9
3. Matt: 13

Verified by computer program, the optimal solution is

9 steps

This can be done four ways, but they are all rotations/reversals of Matt's answer.

LRLRLRLLL

LRLRLRRLL

RLRLRLLRR

RLRLRLRRR

Many longer solutions exist, up to 13 steps, without hitting the same spot more than twice.

More Efficient

Alternate left and right until you've visited all, then head straight for red

RLRLRLRRR

This will traverse:

Red -> Orange -> Violet -> Yellow -> Indigo -> Green -> Blue -> Blue -> Indigo -> Red

Okay, since we have to go back to the end, add a move left or right (lands back on Indigo, since we're at 7 now), then do the above moves in reverse.

RRRLLL L LLLRRR

This will go back to indigo and then touch the other six doors once, ending on red. The final progression:

(Start) Red -> Orange -> Green -> Violet -> Yellow -> Blue -> Indigo -> Indigo -> Blue -> Yellow -> Violet -> Green -> Orange -> Red

• I am afraid you do have to go back to red, nice try though! Jan 13, 2016 at 20:35
• I'll edit the puzzle to make that clearer Jan 13, 2016 at 20:36
• Sure. It's trivially easy to backtrack and end back on where you started.
– Matt
Jan 13, 2016 at 20:43