OFFSET
0,3
COMMENTS
The asymmetry degree of a finite sequence of numbers is defined to be the number of pairs of symmetrically positioned distinct entries. Example: the asymmetry degree of (2,7,6,4,5,7,3) is 2, counting the pairs (2,3) and (6,5).
A sequence is palindromic if and only if its asymmetry degree is 0.
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,3,-2,0,-2,-3,1,1).
FORMULA
G.f.: g(z) = 2z^2/((1+z^2)(1+z-z^2)(1-z-z^2)^2).
a(n) = Sum_{k>=0} k * A275435(n,k).
a(n) = ((10*n + 11 + 5*(-1)^n)*F(n) + (10*n - 7 + 15*(-1)^n)*F(n+1) - 4*(sin(n*Pi/2) + 2*cos(n*Pi/2)))/50, where F(n) = A000045(n) (the Fibonacci numbers). - Emeric Deutsch, Mar 14 2018
a(n) = a(n-1)+3*a(n-2)-2*a(n-3)-2*a(n-5)-3*a(n-6)+a(n-7)+a(n-8). - Maxim Karimov, Aug 23 2020
EXAMPLE
a(4) = 8 because the 00-avoiding binary words of length 4 are 0101, 0110, 0111, 1010, 1011, 1101, 1110, 1111 and the sum of their asymmetry degrees is 2 + 0 + 1 + 2 + 1 + 1 + 1 + 0 = 8.
MAPLE
g := 2*z^2/((1+z^2)*(1+z-z^2)*(1-z-z^2)^2): gser:= series(g, z = 0, 43): seq(coeff(gser, z, n), n = 0 .. 40);
MATHEMATICA
Table[Total@ 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, 0}] == 0 &]], {n, 0, 18}] (* Michael De Vlieger, Aug 15 2016, Version 10.1 *)
PROG
(PARI) concat(vector(2), Vec(2*x^2/((1+x^2)*(1+x-x^2)*(1-x-x^2)^2) + O(x^50))) \\ Colin Barker, Aug 29 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Emeric Deutsch, Aug 15 2016
STATUS
approved