OFFSET
1,1
COMMENTS
A self-generating sequence: there are a(n) 1's between successive pairs 22.
(a(n)) has some similarity with the Kolakoski sequence A000002. It is the fixed point of a 2-block substitution beta. Beta is simply given by
beta(11) = 221221
beta(12) = 2212211
beta(21) = 2211221
beta(22) = 22112211.
However, the fact that beta(a) = a is not entirely trivial, as the iterates of beta are ill-defined (since beta^n(12) and beta^n(21) have odd length for all n>0).
By induction one sees that still, beta(beta(...beta(22))) = sigma^n(22), where sigma is the defining morphism given by sigma(1) = 221, sigma(2) = 2211.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
F. M. Dekking, Regularity and irregularity of sequences generated by automata, Séminaire de Théorie des Nombres de Bordeaux (1979-1980), Exp. No. 9, 10 pp., Univ. Bordeaux I, Talence, 1980.
EXAMPLE
2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2,
2, 2, 1, 1, 2, 2,
MAPLE
f(1):= (2, 2, 1): f(2):= (2, 2, 1, 1):
T:= [2]:
for i from 1 to 5 do T:= map(f, T) od;
T; # Robert Israel, Jan 07 2019
MATHEMATICA
Nest[Flatten[ReplaceAll[#, {1->{2, 2, 1}, 2->{2, 2, 1, 1}}]]&, {2}, 4] (* Paolo Xausa, Nov 09 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Dekking, Jan 05 2019
STATUS
approved