login
{1010->2}-transform of the infinite Fibonacci word A003849.
4

%I #8 Jul 27 2024 04:51:16

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

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

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

%N {1010->2}-transform of the infinite Fibonacci word A003849.

%H Clark Kimberling, <a href="/A285680/b285680.txt">Table of n, a(n) for n = 1..10000</a>

%e As a word, A003849 = 01001010010010100..., and replacing each 1010 by 2 gives 01002010020201002010020201002020100201...

%t s = Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {0}}] &, {0}, 13] ; (* A003849 *)

%t w = StringJoin[Map[ToString, s]]

%t w1 = StringReplace[w, {"1010" -> "2"}]

%t st = ToCharacterCode[w1] - 48; (* A285680 *)

%t Flatten[Position[st, 0]]; (* A285681 *)

%t Flatten[Position[st, 1]]; (* A285682 *)

%t Flatten[Position[st, 2]]; (* A285683 *)

%Y Cf. A003849, A285677, A285681, A285682, A285683.

%K nonn,easy

%O 1,5

%A _Clark Kimberling_, May 11 2017