# That letter sequence started so nicely

Find out how the following letter-sequence is constructed:

S,R,R,L,R,S,R,R,L,R,
S,R,R,L,R,S,R,R,L,R,
S,R,R,L,R,S,R,R,L,R,
S,L,L,S,R,R,L,R,S,R,
R,L,R,S,L,R,L,S,S,R,
R,L,R,S,R,R,L,R,S,L,
S,L,R,S,S,R,R,L,R,S,
R,R,L,R,S,S,S,...


The separation into lines is just to make it more visually appealing and has nothing to do with the logic of the sequence.

The sequence does go on forever.

EDIT: Time for some hints (also covering what was discussed in the answer of eyl327)!

Hint 1:

The choice of the letters S,L,R was not arbitrary. What could they mean and what could the sequence be about?

Hint 2:

The first letter and the logic for determining which letter is added next are enough to construct the whole sequence. Experiment with the rules until you find something that produces the initial "S,R,R,L,R,S".

Hint 3:

The series is infinite, so the rules need some mechanism to recover from getting stuck. Also, what could be triggering the irregular behavior after producing a regular pattern for quite a long time, while allowing it to escape and produce "S,R,R,L,R" again sooner or later.

Hint 4:

The numbers 1,2,3 are quite important for the sequence.

Visual Hint:

It is the patten of S (South), R (right), and L (Left) movements for making a downward diagonal line (where you go backward and forward before going down)

(I have not yet checked the entire sequence)

Update:

There seems to be a pattern but not as simple as originally thought.

• Thank you for the answer. You are on the right track with moving around in a grid. If "S" was south, wouldn't it be more consequent to use "E" and "W" instead of "L" and "R"? Also, as you have noted, the sequence takes quite a while to become irregular. What could cause this? Commented Mar 28, 2020 at 20:07

Progress?

Solver eyl327’s visual approach is reminiscent of a picture from another puzzle, leading to this worksheet and a couple others, not necessarily mistake-free, ...

                              1r > > 1s > > 1r             srrlr srrlr
^            v              srrlr srrlr
^            v              srrlr srrlr SLL
1r > > 1l     1l < < 1r             srrlr srrlr SLRLS
start          ^            v                     srrlr srrlr SLSLRS
' .        ^            v                     srrlr srrlr SSS
' .   2L < < 2S < < 2r
' v.             ^
v  ' .         ^
1r > > 1r     1L < < 4R > > 4S > > 4L
^     v      v       ^            v
^     v      v       ^            v
1s     1l > > 5r > > 3l     3l < < 3r
^            v^            v
^            v^            v
1r < < 1l     5S < < 3s < < 4R > > 2r > > 2S > > 2S > > 1S > > O
^     v              ^      ^            v              '.
^     v              ^      ^            v                '.
1r < < 2L > > 1S > > 2r > > 1l     1l < < 1r                 '.
^            v                          end
^            v
1r < < 1s < < 1r


... where S, R and L are interpreted as ...

... go Straight, turn Right 90° and turn Left 90°, ...

... like turtle graphics.

Overwriting has obscured some information in the worksheet above but the resulting form is suggestive in many ways. For instance, for what it’s worth, the path doesn't seem to cross itself and only one segment is traversed in both directions.

Here is the two-for-one S,R,R,L,R,S,R,R,L,R repeating portion of the sequence:

                                    start and end of the loop formed by
.'            S,R,R,L,R,S,R,R,L,R
.'
.'
1r > > 1O > > 1r           srrlr
^            v            srrlr
^            v
1r > > 1l     1l < < 1r
^            v
^            v
1r < < 1s < < 1r


Reducing that S,R,R,L,R,S,R,R,L,R portion to a smaller R,R,R,R loop makes the entire given sequence look like:

                                     1r > > 1r            rr rr
start               ^     v             rr rr
'.              ^     v             rr rr SLL
'.    1L < < 2S < < 2r            rr rr SLRLS
'.  v              ^            rr rr SLSLRS
'.v              ^            rr rr SSS
1L < < 4R > > 4S > > 1L
v       ^     v                    Starting direction
v       ^     v                    is eastward
1r > > 2r     3r < < 3r
^     v
^     v
1r < < 2S            1R > > 2r > > 2S > > 1S > > 1S > > O
v              ^      ^     v                 .'
v              ^      ^     v               .'
1L > > 1S > > 1L     1r < < 1r            .'
end


So far my candidates for an underlying rule have met with inconsistencies so if you see potential in any of this, feel free to post a follow-up. I've been sitting on this egg long enough to wonder if someone else could hatch it.

• Yes, you are correct that this is pretty much like turtle graphics! I added a visual hint (without explanation, for now) to the question. (Looking back, I probably should have included that image to begin with.) Commented Apr 8, 2020 at 17:14