OFFSET
0,7
COMMENTS
A symmetric valley is an index i such that p_i = p_{i+2} > p_{i+1}. Its depth is defined as p_i - p_{i+1}.
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 (2,3,-3,-6,-3,4,4).
FORMULA
a(n) = (-6*n+7)/108*(-1)^n + (21*n-79)/1323*2^n + (-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/12.
G.f.: -x^5/((x-1)*(x^2+x+1)*(x+1)^2*(-1+2*x)^2). - Alois P. Heinz, Feb 04 2026
a(n) = (441 + 2^(n+2)*(21*n-79) + (-1)^n*(49*(7 - 6*n) - 468*cos(Pi*n/3) + 108*sqrt(3)*sin(Pi*n/3)))/5292. - Vaclav Kotesovec, Feb 05 2026
EXAMPLE
For n=7, there are 6 compositions with at least one symmetric valley: 11212, 12121, 21211, 2122, 2212, 313. The sum of the depths of symmetric valleys over these compositions is 7.
MATHEMATICA
A393177[n_] := (441 + 2^(n + 2)*(21*n - 79) + (-1)^n*(49*(7 - 6*n) - 468*Cos[#] + 108*Sqrt[3]*Sin[#]))/5292 & [Pi*n/3];
Array[A393177, 50, 0] (* or *)
LinearRecurrence[{2, 3, -3, -6, -3, 4, 4}, {0, 0, 0, 0, 0, 1, 2}, 50] (* Paolo Xausa, Mar 28 2026 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
W. Asakly, Feb 04 2026
STATUS
approved
