login
Run lengths of the Fibonacci word (A003849).
1

%I #31 Apr 30 2024 08:28:56

%S 1,1,2,1,1,1,2,1,2,1,1,1,2,1,1,1,2,1,2,1,1,1,2,1,2,1,1,1,2,1,1,1,2,1,

%T 2,1,1,1,2,1,1,1,2,1,2,1,1,1,2,1,2,1,1,1,2,1,1,1,2,1,2,1,1,1,2,1,2,1,

%U 1,1,2,1,1,1,2,1,2,1,1,1,2,1,1,1,2,1,2

%N Run lengths of the Fibonacci word (A003849).

%C The sequence is generated by applying the coding 0->1 1->1 2->2 3->2 4->1 5->1 6->1 7->2 8->1 9->1 to the fixed point of the sequence generated by iterating the morphism 0->01 1->2 2->45 3->91 4->67 5->4 6->28 7->9 8->6 9->31. Alternatively, there is a 10-state automaton to compute the n-th term (where the input is the Zeckendorf representation of n).

%H A.H.M. Smeets, <a href="/A363057/b363057.txt">Table of n, a(n) for n = 1..20000</a>

%F a(2*n) = 1. - _A.H.M. Smeets_, Mar 31 2024

%e The first 6 terms of A003849 are 0,1,0,0,1,0 so the first 4 terms of the run-length encoding are 1,1,2,1.

%t Map[Length, Most[Split[Nest[Flatten[ReplaceAll[#, {0 -> {0, 1}, 1 -> 0}]] &, 0, 10]]]] (* _Paolo Xausa_, Apr 30 2024 *)

%Y Cf. A003849, A096270.

%K nonn

%O 1,3

%A _Jeffrey Shallit_, May 15 2023