OFFSET
0,8
COMMENTS
See A118340 for definition of pendular triangles and pendular sums.
LINKS
G. C. Greubel, Rows n = 0..100 of the triangle, flattened
FORMULA
EXAMPLE
Row 6 equals the pendular sums of row 5:
[1, 4, 11, 6, 1, 0], where the pendular sums proceed as follows:
[1, __, __, __, __, __]: T(6,0) = T(5,0) = 1;
[1, __, __, __, __, 1]: T(6,5) = T(6,0) + 2*T(5,5) = 1 + 2*0 = 1;
[1, 5, __, __, __, 1]: T(6,1) = T(6,5) + T(5,1) = 1 + 4 = 5;
[1, 5, __, __, 7, 1]: T(6,4) = T(6,1) + 2*T(5,4) = 5 + 2*1 = 7;
[1, 5, 18, __, 7, 1]: T(6,2) = T(6,4) + T(5,2) = 7 + 11 = 18;
[1, 5, 18, 30, 7, 1]: T(6,3) = T(6,2) + 2*T(5,3) = 18 + 2*6 = 30;
[1, 5, 18, 30, 7, 1, 0] finally, append a zero to obtain row 6.
Triangle begins:
1;
1, 0;
1, 1, 0;
1, 2, 1, 0;
1, 3, 5, 1, 0;
1, 4, 11, 6, 1, 0;
1, 5, 18, 30, 7, 1, 0;
1, 6, 26, 70, 40, 8, 1, 0;
1, 7, 35, 121, 201, 51, 9, 1, 0;
1, 8, 45, 184, 487, 286, 63, 10, 1, 0;
1, 9, 56, 260, 873, 1445, 386, 76, 11, 1, 0;
1, 10, 68, 350, 1375, 3592, 2147, 502, 90, 12, 1, 0; ...
Central terms are T(2*n,n) = A118346(n);
semi-diagonals form successive self-convolutions of the central terms:
MATHEMATICA
T[n_, k_, p_]:= T[n, k, p] = If[n<k || k<0, 0, If[k==0, 1, If[k==n, 0, If[n<=2*k, T[n, n-k-1, p] + p*T[n-1, k, p], T[n, n-k, p] + T[n-1, k, p] ]]]];
Table[T[n, k, 2], {n, 0, 12}, {k, 0, n}]//Flatten (* G. C. Greubel, Feb 17 2021 *)
PROG
(PARI) T(n, k)=if(n<k || k<0, 0, if(k==0, 1, if(n==k, 0, if(n>2*k, T(n, n-k)+T(n-1, k), T(n, n-1-k)+2*T(n-1, k)))))
(Sage)
@CachedFunction
def T(n, k, p):
if (k<0 or n<k): return 0
elif (k==0): return 1
elif (k==n): return 0
elif (n>2*k): return T(n, n-k, p) + T(n-1, k, p)
else: return T(n, n-k-1, p) + p*T(n-1, k, p)
flatten([[T(n, k, 2) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Feb 17 2021
(Magma)
function T(n, k, p)
if k lt 0 or n lt k then return 0;
elif k eq 0 then return 1;
elif k eq n then return 0;
elif n gt 2*k then return T(n, n-k, p) + T(n-1, k, p);
else return T(n, n-k-1, p) + p*T(n-1, k, p);
end if;
return T;
end function;
[T(n, k, 2): k in [0..n], n in [0..12]]; // G. C. Greubel, Feb 17 2021
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Paul D. Hanna, Apr 26 2006
STATUS
approved