OFFSET
0,4
COMMENTS
The degree of asymmetry of a finite sequence of numbers is defined to be the number of pairs of symmetrically positioned distinct entries. Example: the degree of asymmetry 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 degree of asymmetry is 0.
LINKS
V. E. Hoggatt, Jr., and Marjorie Bicknell, Palindromic compositions, Fibonacci Quart., Vol. 13(4), 1975, pp. 350-356.
Index entries for linear recurrences with constant coefficients, signature (3,0,-4).
FORMULA
G.f.: g(z) = 2z^3(1-z)/((1-2z)(1-z-2z^2). In the more general situation of compositions into a[1]<a[2]<a[3]<..., denoting F(z) = Sum(z^{a[j]}, j>=1}, we have g(z) = (F(z)^2 - F(z^2))/((1+F(z))(1-F(z))^2).
a(n) = - (4/9)*(-1)^n + (3n - 2)*2^n/36 for n>=2; a(1)=0
a(n) = Sum(k*A275433(n,k), k>=0).
a(n) = 2*A059570(n-2) for n>=3. - Alois P. Heinz, Jul 29 2016
EXAMPLE
a(4) = 4 because the compositions 4, 13, 22, 31, 112, 121, 211, 1111 have degrees of asymmetry 0, 1, 0, 1, 1, 0, 1, 0, respectively.
MAPLE
g := 2*z^3*(1-z)/((1-2*z)*(1-z-2*z^2)): gser := series(g, z = 0, 35): seq(coeff(gser, z, n), n = 0 .. 32);
a := proc(n) if n = 0 then 0 elif n = 1 then 0 else -(4/9)*(-1)^n+(1/36)*(3*n-2)*2^n end if end proc: seq(a(n), n = 0 .. 32);
MATHEMATICA
b[n_, i_] := b[n, i] = Expand[If[n==0, 1, Sum[b[n - j, If[i==0, j, 0]] If[i > 0 && i != j, x, 1], {j, 1, n}]]];
a[n_] := Function[p, Sum[i Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][ b[n, 0]];
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Emeric Deutsch, Jul 29 2016
STATUS
approved