login
A238763
A Motzkin triangle read by rows, 0<=k<=n.
1
1, 0, 1, 1, 0, 2, 0, 2, 0, 4, 1, 0, 5, 0, 9, 0, 3, 0, 12, 0, 21, 1, 0, 9, 0, 30, 0, 51, 0, 4, 0, 25, 0, 76, 0, 127, 1, 0, 14, 0, 69, 0, 196, 0, 323, 0, 5, 0, 44, 0, 189, 0, 512, 0, 835, 1, 0, 20, 0, 133, 0, 518, 0, 1353, 0, 2188, 0, 6, 0, 70, 0, 392, 0, 1422, 0
OFFSET
0,6
COMMENTS
Similar to A020474 but with a different enumeration.
Compare with the definition of the generalized ballot numbers A238762.
FORMULA
Definition: T(0, 0) = 1; T(p, q) = 0 if p < 0 or p > q; T(p, q) = T(p-2, q) + T(p-1, q-1) + T(p, q-2). (The notation is in the style of Knuth, TAOCP 4a (7.2.1.6)).
T(n, n) = A001006(n).
Sum_{0<=k<=n} T(n, k) = A005043(n+2).
EXAMPLE
[n\k 0 1 2 3 4 5 6 7]
[0] 1,
[1] 0, 1,
[2] 1, 0, 2,
[3] 0, 2, 0, 4,
[4] 1, 0, 5, 0, 9,
[5] 0, 3, 0, 12, 0, 21,
[6] 1, 0, 9, 0, 30, 0, 51,
[7] 0, 4, 0, 25, 0, 76, 0, 127.
PROG
(Sage)
@CachedFunction
def T(p, q):
if p == 0 and q == 0: return 1
if p < 0 or p > q: return 0
return T(p-2, q) + T(p-1, q-1) + T(p, q-2)
[[T(p, q) for p in (0..q)] for q in (0..9)]
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Peter Luschny, Mar 05 2014
STATUS
approved