A275437 Triangle read by rows: T(n,k) is the number of 01-avoiding binary words of length n having degree of asymmetry equal to k (n >= 0; 0 <= k <= floor(n/2)).
1, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1
Offset: 0
Examples
Row 4 is [2,2,1] because the 01-avoiding binary words of length 4 are 0000, 1000, 1100, 1110, and 1111, having asymmetry degrees 0, 1, 2, 1, and 0, respectively. Triangle starts: 1; 2; 2, 1; 2, 2; 2, 2, 1; 2, 2, 2.
Links
- Michael De Vlieger, Table of n, a(n) for n = 0..9999 (rows 0 <= n <= 199).
Programs
-
Maple
T:= proc(n,k) if n = 2*k then 1 elif k <= floor((1/2)*n) then 2 else 0 end if end proc: for n from 0 to 20 do seq(T(n,j),j=0..floor((1/2)*n)) end do; # yields sequence in triangular form
-
Mathematica
Table[BinCounts[#, {0, Floor[n/2] + 1, 1}] &@ Map[Total@ BitXor[Take[#, Ceiling[Length[#]/2]], Reverse@ Take[#, -Ceiling[Length[#]/2]]] &, Select[PadLeft[IntegerDigits[#, 2], n] & /@ Range[0, 2^n - 1], Length@ SequenceCases[#, {0, 1}] == 0 &]], {n, 0, 15}] // Flatten (* Michael De Vlieger, Aug 15 2016, Version 10.1 *) Table[If[k == n/2, 1, 2], {n, 15}, {k, Floor[n/2]}] (* Michael De Vlieger, Nov 05 2017 *)
Formula
T(2k,k)=1 (k >= 0); T(n,k)=2 if k <= floor(n/2); T(n,k)=0 if k > floor(n/2).
G.f.: G(t,z) = (1 + z)/((1 - z)(1 - tz^2)).
Comments