A374835 Number of ternary paths of length 3*n having exactly 1 hill.
0, 1, 0, 4, 14, 72, 370, 1995, 11064, 62774, 362614, 2125479, 12610410, 75584363, 457000668, 2783991972, 17071362986, 105287143740, 652687596388, 4064618917998, 25416557913498, 159523021737403, 1004594882114020, 6345859437931884, 40198433775513524
Offset: 0
Keywords
Links
- Naiomi Cameron and J. E. McLeod, Returns and Hills on Generalized Dyck Paths, Journal of Integer Sequences, Vol. 19, 2016, #16.6.1.
Programs
-
PARI
a(n) = sum(k=0, n-1, (-1)^k*(k+1)*(k+2)/(2*n-k)*binomial(3*n-2-2*k, n-1-k));
Formula
a(n) = Sum_{k=0..n-1} (-1)^k * (k+1)*(k+2)/(2*n-k) * binomial(3*n-2-2*k,n-1-k).
G.f.: x * (g/(1 + x*g))^2, where g = 1 + x*g^3.