%I #35 Jul 31 2024 16:05:45
%S 1,0,1,1,0,1,0,0,1,0,1,1,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,0,1,0,0,1,0,
%T 1,1,0,1,0,0,1,0,1,1,1,0,1,1,1,0,1,1,0,1,0,0,1,0,1,1,1,0,1,1,0,1,0,0,
%U 1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1
%N Paradiddle Thue-Morse.
%C A paradiddle is a basic pattern when learning drums, as either "left left right left" or "right right left right".
%C A paradiddle as a Thue-Morse type sequence can be done by convention of left being 0 and right being 1, or vice-verse.
%C Limiting word of the morphism with maps 0 |--> 0100, 1 |--> 1011 and axiom 1011. - _Joerg Arndt_, Jul 15 2024
%H <a href="/index/Fi#FIXEDPOINTS">Index entries for sequences that are fixed points of mappings</a>
%e k = 0: Sequence starts at its simplest form;
%e 1.
%e -----------------------------------------------
%e k = 1: The 1 of the initial sequence expands following the morphism rules, where 1 -> {1, 0, 1, 1} and 0 -> {0, 1, 0, 0}, resulting in;
%e 1, 0, 1, 1.
%e -----------------------------------------------
%e k = 2: Each element of the initial sequence expands following the morphism rules, where 1 -> {1, 0, 1, 1} and 0 -> {0, 1, 0, 0};
%e 1, 0, 1, 1,
%e 0, 1, 0, 0,
%e 1, 0, 1, 1,
%e 1, 0, 1, 1.
%e -----------------------------------------------
%e k = 3: The expansion is applied recursively based on k-1, resulting in;
%e 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1,
%e 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0,
%e 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1,
%e 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1.
%t SubstitutionSystem[{1 -> {1, 0, 1, 1}, 0 -> {0, 1, 0, 0}}, {1}, {4}] // Flatten
%o (PARI) first(n,v=[1])=if(n>4*#v, v=first((n+3)\4)); my(u=List()); for(i=1,#v-1, listput(u,v[i]); listput(u,1-v[i]); listput(u,v[i]); listput(u,v[i])); my(t=vector(n-#u,i,if(i==2,1-v[#v],v[#v]))); for(j=1,#t, listput(u,t[j])); Vec(u) \\ _Charles R Greathouse IV_, Jul 31 2024
%Y Cf. A130198 (single paradiddle).
%Y Cf. A010059, A010060.
%Y Cf. A374724.
%K nonn,easy
%O 0,1
%A _Robert P. P. McKone_, Jul 15 2024