login
Let s denote the 4-symbol substitution 1->{2, 3}, 2->{3, 4}, 3->{}, 4->{1, 3}; let S(1) = 1, and S(n+1) = concat( S(n), s(S(n)) ); then the sequence is S(1), S(2), S(3), ...
1

%I #36 Apr 13 2024 09:03:03

%S 1,1,2,3,1,2,3,2,3,3,4,1,2,3,2,3,3,4,2,3,3,4,3,4,1,3,1,2,3,2,3,3,4,2,

%T 3,3,4,3,4,1,3,2,3,3,4,3,4,1,3,3,4,1,3,1,3,2,3,1,2,3,2,3,3,4,2,3,3,4,

%U 3,4,1,3,2,3,3,4,3,4,1,3,3,4,1,3,1,3,2,3,2,3,3,4,3,4,1,3,3,4,1,3,1,3,2,3,3

%N Let s denote the 4-symbol substitution 1->{2, 3}, 2->{3, 4}, 3->{}, 4->{1, 3}; let S(1) = 1, and S(n+1) = concat( S(n), s(S(n)) ); then the sequence is S(1), S(2), S(3), ...

%H Kevin Ryde, <a href="/A105316/a105316.gp.txt">PARI/GP Code</a>

%t s[1] = {2, 3}; s[2] = {3, 4}; s[3] = {}; s[4] = {1, 3};

%t t[a_] := Join[a, Flatten[s /@ a]];

%t p[0] = {1}; p[1] = t[{1}]; p[n_] := t[p[n - 1]];

%t Flatten[Table[p[n], {n, 0, 6}]]

%o (PARI) \\ See links.

%K nonn

%O 0,3

%A _Roger L. Bagula_, Apr 25 2005

%E Definition of s[4] corrected at the suggestion of Kevin Ryde by _Georg Fischer_, Mar 20 2024

%E Definition rewritten at the suggestion of _Kevin Ryde_ - _N. J. A. Sloane_, Mar 23 2024