A274497 Sum of the degrees of asymmetry of all binary words of length n.
0, 0, 2, 4, 16, 32, 96, 192, 512, 1024, 2560, 5120, 12288, 24576, 57344, 114688, 262144, 524288, 1179648, 2359296, 5242880, 10485760, 23068672, 46137344, 100663296, 201326592, 436207616, 872415232, 1879048192, 3758096384, 8053063680
Offset: 0
Examples
a(3) = 4 because the binary words 000, 001, 010, 100, 011, 101, 110, 111 have degrees of asymmetry 0, 1, 0, 1, 1, 0, 1, 0, respectively.
Links
- Index entries for linear recurrences with constant coefficients, signature (2,4,-8).
Programs
-
Maple
a:= proc(n) options operator, arrow: (1/8)*(2*n-1+(-1)^n)*2^n end proc: seq(a(n), n = 0 .. 30);
-
Mathematica
LinearRecurrence[{2, 4, -8}, {0, 0, 2}, 31] (* Jean-François Alcover, Nov 16 2022 *)
-
PARI
a(n)=(2*n-1+(-1)^n)*2^n/8 \\ Charles R Greathouse IV, Jul 08 2024
Formula
a(n) = (1/8)*(2n - 1 + (-1)^n)*2^n.
a(n) = Sum_{k>=0} k*A274496(n,k).
From Alois P. Heinz, Jul 27 2016: (Start)
a(n) = 2^(n-1) * A004526(n) = 2^(n-1)*floor(n/2).
a(n) = 2 * A134353(n-2) for n>=2. (End)
From Chai Wah Wu, Dec 27 2018: (Start)
a(n) = 2*a(n-1) + 4*a(n-2) - 8*a(n-3) for n > 2.
G.f.: 2*x^2/((2*x - 1)^2*(2*x + 1)). (End)
Comments