login
A107337
Substitution 1->{1, 2, 1, 3, 2, 3, 1}, 2->{3}, 3->{1}, starting with 1.
1
1, 2, 1, 3, 2, 3, 1, 3, 1, 2, 1, 3, 2, 3, 1, 1, 3, 1, 1, 2, 1, 3, 2, 3, 1, 1, 1, 2, 1, 3, 2, 3, 1, 3, 1, 2, 1, 3, 2, 3, 1, 1, 3, 1, 1, 2, 1, 3, 2, 3, 1, 1, 2, 1, 3, 2, 3, 1, 1, 1, 2, 1, 3, 2, 3, 1, 1, 2, 1, 3, 2, 3, 1, 3, 1, 2, 1, 3, 2, 3, 1, 1, 3, 1, 1, 2, 1, 3, 2, 3, 1, 1, 2, 1, 3, 2, 3, 1, 1, 2, 1, 3, 2, 3, 1
OFFSET
0,2
COMMENTS
Original name was: 223 Pisot cubic substitution with characteristic polynomial: x^3-3*x^2-2*x-2.
EXAMPLE
Start: 1
Rules:
1 --> 1213231
2 --> 3
3 --> 1
-------------
0: (#=1)
1
1: (#=7)
1213231
2: (#=25)
1213231312132311311213231
3: (#=91)
1213231312132311311213231112132313121323113112132311213231112132311213231312132311311213231
4: (#=337)
12132313121323113112132311121323131213231131121323112132 ...
MATHEMATICA
s[1] = {1, 2, 1, 3, 2, 3, 1}; s[2] = {3}; s[3] = {1}; t[a_] := Flatten[s /@ a]; p[0] = {1}; p[1] = t[p[0]]; p[n_] := t[p[n - 1]] aa = p[4]
PROG
(Python)
from itertools import chain
A107337 = [1]
for _ in range(4):
....A107337 = list(chain.from_iterable(([1, 2, 1, 3, 2, 3, 1] if d == 1 else [3] if d == 2 else [1] for d in A107337)))
# Chai Wah Wu, Sep 03 2014
CROSSREFS
Sequence in context: A293390 A363654 A189231 * A066376 A151682 A318928
KEYWORD
nonn,easy
AUTHOR
Roger L. Bagula, May 22 2005
EXTENSIONS
Edited by Joerg Arndt, Jun 26 2011
STATUS
approved