login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A105728
Triangle read by rows: T(n,1) = 1, T(n,n) = n and for 1 < k < n: T(n,k) = T(n-1,k-1) + 2*T(n-1,k).
7
1, 1, 2, 1, 5, 3, 1, 11, 11, 4, 1, 23, 33, 19, 5, 1, 47, 89, 71, 29, 6, 1, 95, 225, 231, 129, 41, 7, 1, 191, 545, 687, 489, 211, 55, 8, 1, 383, 1281, 1919, 1665, 911, 321, 71, 9, 1, 767, 2945, 5119, 5249, 3487, 1553, 463, 89, 10, 1, 1535, 6657, 13183, 15617, 12223, 6593, 2479, 641, 109, 11
OFFSET
1,3
COMMENTS
Sum of n-th row = 3^(n-1): Sum_{k=1..n} T(n,k) = A000244(n-1);
for n>1: T(n,2) = A083329(n-1), T(n,n-1) = A028387(n-2).
LINKS
EXAMPLE
Triangle begins as:
1;
1, 2;
1, 5, 3;
1, 11, 11, 4;
1, 23, 33, 19, 5;
1, 47, 89, 71, 29, 6;
...
MAPLE
T:= proc(n, k) option remember;
if k=1 then 1
elif k=n then n
else T(n-1, k-1) + 2*T(n-1, k)
fi
end:
seq(seq(T(n, k), k=1..n), n=1..12); # G. C. Greubel, Nov 13 2019
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k==1, 1, If[k==n, n, T[n-1, k-1] + 2*T[n-1, k]]];
Table[T[n, k], {n, 12}, {k, n}]//Flatten (* G. C. Greubel, Nov 13 2019 *)
PROG
(Haskell)
a105728 n k = a105728_tabl !! (n-1) !! (k-1)
a105728_row n = a105728_tabl !! (n-1)
a105728_tabl = iterate (\row -> zipWith (+) ([0] ++ tail row ++ [1]) $
zipWith (+) ([0] ++ row) (row ++ [0])) [1]
-- Reinhard Zumkeller, Jul 22 2013
(Magma)
function T(n, k)
if k eq 1 then return 1;
elif k eq n then return n;
else return T(n-1, k-1) + 2*T(n-1, k);
end if;
return T;
end function;
[T(n, k): k in [1..n], n in [1..12]]; // G. C. Greubel, Nov 13 2019
(Sage)
@CachedFunction
def T(n, k):
if (k==1): return 1
elif (k==n): return n
else: return T(n-1, k-1) + 2*T(n-1, k)
[[T(n, k) for k in (1..n)] for n in (1..12)] # G. C. Greubel, Nov 13 2019
CROSSREFS
Sequence in context: A209130 A330381 A210792 * A120095 A327631 A130197
KEYWORD
nonn,tabl
AUTHOR
Reinhard Zumkeller, Apr 18 2005
STATUS
approved