login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; table; graph; refs; listen; history; text; internal format)
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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 19 04:58 EDT 2024. Contains 370952 sequences. (Running on oeis4.)