OFFSET
1,2
LINKS
G. C. Greubel, Rows n = 1..50 of the triangle, flattened
FORMULA
T(n, k) = m*(T(n-1, k-1) + T(n-1, k)), where T(n, 1) = T(n, n) = n, and m = 2.
From G. C. Greubel, Oct 02 2024: (Start)
Sum_{k=1..n} T(n, k) = (1/9)*(7*4^n + 6*n + 2).
Sum_{k=1..n} (-1)^(k-1)*T(n, k) = (1-(-1)^n)*(2-n) - [n=1]. (End)
EXAMPLE
Triangle begins as:
1;
2, 2;
3, 8, 3;
4, 22, 22, 4;
5, 52, 88, 52, 5;
6, 114, 280, 280, 114, 6;
7, 240, 788, 1120, 788, 240, 7;
8, 494, 2056, 3816, 3816, 2056, 494, 8;
9, 1004, 5100, 11744, 15264, 11744, 5100, 1004, 9;
10, 2026, 12208, 33688, 54016, 54016, 33688, 12208, 2026, 10;
MATHEMATICA
m = 2; T[n_, k_]:= T[n, k]= If[k==1 || k==n, n, m*(T[n-1, k-1] + T[n-1, k])]; Table[T[n, k], {n, 10}, {k, n}]//Flatten
PROG
(Magma)
function T(n, k) // T = A177696
if k lt 1 or k gt n then return 0;
elif k eq 1 or k eq n then return n;
else return 2*(T(n-1, k-1) + T(n-1, k));
end if;
end function;
[T(n, k): k in [1..n], n in [1..12]]; // G. C. Greubel, Oct 02 2024
(SageMath)
@CachedFunction
def T(n, k): # T = A177696
if (k<0 or k>n): return 0
elif (k==1 or k==n): return n
else: return 2*(T(n-1, k-1) + T(n-1, k))
flatten([[T(n, k) for k in range(1, n+1)] for n in range(1, 13)]) # G. C. Greubel, Oct 02 2024
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, May 11 2010
EXTENSIONS
Edited by G. C. Greubel, Oct 02 2024
STATUS
approved