[go: up one dir, main page]

login
A214640
A ternary sequence : closed under 1 -> 123, 2 -> 12, 3 -> 2 . Start with 1 .
4
1, 2, 3, 1, 2, 2, 1, 2, 3, 1, 2, 1, 2, 1, 2, 3, 1, 2, 2, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 2, 1, 2, 3, 1, 2, 1, 2, 1, 2, 3, 1, 2, 2, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 2, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 2, 1, 2, 3, 1, 2, 1, 2, 1, 2, 3, 1, 2, 2, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 2, 1, 2, 3, 1, 2, 1, 2, 1, 2, 3, 1, 2, 2, 1, 2, 3, 1, 2
OFFSET
1,2
LINKS
EXAMPLE
Start: 1
Rules:
1 --> 123
2 --> 12
3 --> 2
-------------
0: (#=1)
1
1: (#=3)
123
2: (#=6)
123122
3: (#=13)
1231221231212
4: (#=29)
12312212312121231221231212312
5: (#=64)
1231221231212123122123121231212312212312121231221231212312212312
MAPLE
S:= proc(n) option remember; `if`(n=0, [1], subs(x=[1, 2, 3][],
y=[1, 2][], z=2, subs(1=x, 2=y, 3=z, S(n-1))))
end:
a:= proc(n) local k;
for k while nops(S(k))<n do od; S(k)[n]
end:
seq(a(n), n=1..100); # Alois P. Heinz, Jul 28 2012
MATHEMATICA
SubstitutionSystem[{1 -> {1, 2, 3}, 2 -> {1, 2}, 3 -> {2}}, {1}, 6] // Last (* Jean-François Alcover, Nov 04 2020 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Philippe Deléham, Jul 23 2012
STATUS
approved