OFFSET
2,2
LINKS
Xiaomei Chen, Table of n, a(n) for n = 2..401
Xiaomei Chen, Counting humps and peaks in Motzkin paths with height k, arXiv:2412.00668 [math.CO], Dec 2024.
FORMULA
G.f.: Sum_{n>=2, k>=1} T(n,k) * x^n * y^k = x^2 * M^2(x) * y / ((1-x) * (1 - x^2 * M^2(x) * y)), where M(x) is the g.f. for A001006.
T(n,k) = Sum_{i=0..n-2*k, i==n (mod 2)} (4*k) / (n-i+2*k) * binomial(n,i) * binomial(n-i-1,(n-i)/2+k-1).
T(n,k) = Sum_{i=2k-1..n-1} A064189(i,2k-1).
T(n,k) + T(n,k+1) = A064189(n,2k).
EXAMPLE
Triangle begins:
[2] 1;
[3] 3;
[4] 8, 1;
[5] 20, 5;
[6] 50, 19, 1;
[7] 126, 63, 7;
[8] 322, 196, 34, 1;
[9] 834, 588, 138, 9;
[10] 2187, 1728, 507, 53, 1;
...
PROG
(Sage)
def A379838_triangel(dim):
M = matrix(ZZ, dim, dim)
for n in (2..dim+1):
for k in (1..math.floor(n/2)+1):
for i in range(n-2*k+1):
if ((n-i)%2)==0:
M[n-2, k-1]=M[n-2, k-1]+(4*k)/(n-i+2*k)*binomial(n, i)*binomial(n-i-1, (n-i)/2+k-1)
return M
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Xiaomei Chen, Jan 04 2025
STATUS
approved