OFFSET
0,6
COMMENTS
A symmetric peak in a composition p = (p_1, ..., p_k) is an index i, 1 <= i <= k-2, such that p_i = p_{i+2} < p_{i+1}. Its height is defined as p_{i+1} - p_i.
LINKS
Paolo Xausa, Table of n, a(n) for n = 0..1000
W. Asakly and N. Kezil, The heights of symmetric peaks and the depth of symmetric valleys over compositions of an integer, arXiv:2408.09166 [math.CO], 2024.
Index entries for linear recurrences with constant coefficients, signature (4,-4,1,-4,4).
FORMULA
a(n) = (7*n-24)/49*2^(n-1) + (-33-15*i*sqrt(3))*(-2)^n/(441*(1+i*sqrt(3))^(n+1)) + (-33+15*i*sqrt(3))*(-2)^n/(441*(1-i*sqrt(3))^(n+1)) + 1/3.
G.f.: -x^4/((x-1)*(x^2+x+1)*(-1+2*x)^2). - Alois P. Heinz, Feb 04 2026
a(n) = (98 + 3*2^n*(7*n-24) + 2*(-1)^n * (3^(3/2)*sin(Pi*n/3) - 13*cos(Pi*n/3)))/294. - Vaclav Kotesovec, Feb 05 2026
EXAMPLE
For n=5, there are three compositions with at least one symmetric peak: 131, 1211, and 1121. The sum of the heights of symmetric peaks over these compositions is 2+1+1 = 4.
MAPLE
# a(n) = hsp(n) from the closed form
a := proc(n::nonnegint)
local expr;
expr :=
(7*n - 24)/49 * 2^(n-1)
+ (-33 - 15*I*sqrt(3)) * (-2)^n / (441 * (1 + I*sqrt(3))^(n+1))
+ (-33 + 15*I*sqrt(3)) * (-2)^n / (441 * (1 - I*sqrt(3))^(n+1))
+ 1/3;
# simplify (the complex parts cancel)
return simplify(expr, symbolic);
end proc:
# first 20 terms
seq(a(n), n=0..20);
MATHEMATICA
A393175[n_] := (98 + 3*2^n*(7*n - 24) + 2*(-1)^n*(3^(3/2)*Sin[#] - 13*Cos[#]))/294 & [Pi*n/3];
Array[A393175, 50, 0] (* or *)
LinearRecurrence[{4, -4, 1, -4, 4}, {0, 0, 0, 0, 1}, 50] (* Paolo Xausa, Mar 28 2026 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
W. Asakly, Feb 04 2026
STATUS
approved
