login
A374836
Number of ternary paths of length 3*n having exactly 2 hills.
1
0, 0, 1, 0, 6, 21, 114, 597, 3278, 18420, 105618, 615331, 3632352, 21678975, 130598887, 793085742, 4849791942, 29838388707, 184573315170, 1147219365762, 7161284719412, 44876343104655, 282206695488603, 1780341161583746, 11264338644455334, 71461150894269030
OFFSET
0,5
LINKS
Naiomi Cameron and J. E. McLeod, Returns and Hills on Generalized Dyck Paths, Journal of Integer Sequences, Vol. 19, 2016, #16.6.1.
FORMULA
a(n) = Sum_{k=0..n-2} (-1)^k * (k+1)*(k+2)*(k+3)/(2*(2*n-1-k)) * binomial(3*n-4-2*k,n-2-k).
G.f.: x^2 * (g/(1 + x*g))^3, where g = 1 + x*g^3.
PROG
(PARI) a(n) = sum(k=0, n-2, (-1)^k*(k+1)*(k+2)*(k+3)/(2*(2*n-1-k))*binomial(3*n-4-2*k, n-2-k));
CROSSREFS
Column k=2 of A101371.
Sequence in context: A364328 A298837 A009253 * A365880 A251593 A012840
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Jul 21 2024
STATUS
approved