login
A136680
Triangle T(n, k) = f(k) for k < n+1, otherwise 0, where f(k) = f(k-1) + k^(k-2)*f(k-2) with f(0) = 0 and f(1) = 1, read by rows.
1
1, 1, 1, 1, 1, 4, 1, 1, 4, 20, 1, 1, 4, 20, 520, 1, 1, 4, 20, 520, 26440, 1, 1, 4, 20, 520, 26440, 8766080, 1, 1, 4, 20, 520, 26440, 8766080, 6939853440, 1, 1, 4, 20, 520, 26440, 8766080, 6939853440, 41934828744960, 1, 1, 4, 20, 520, 26440, 8766080, 6939853440, 41934828744960, 694027278828744960
OFFSET
1,6
FORMULA
T(k) = T(k-1) + n^(k-2)*T(k-2), with T(0) = 0, T(1) = 1.
T(n, k) = f(k) for k < n+1, otherwise 0, where f(k) = f(k-1) + k^(k-2)*f(k-2) with f(0) = 0 and f(1) = 1. - G. C. Greubel, Dec 01 2022
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 1, 4;
1, 1, 4, 20;
1, 1, 4, 20, 520;
1, 1, 4, 20, 520, 26440;
1, 1, 4, 20, 520, 26440, 8766080;
1, 1, 4, 20, 520, 26440, 8766080, 6939853440;
1, 1, 4, 20, 520, 26440, 8766080, 6939853440, 41934828744960;
MATHEMATICA
T[k_]:= T[k]= If[k<2, k, T[k-1] + n^(k-2)*T[k-2]];
Table[T[k], {n, 10}, {k, n}]//Flatten
PROG
(Magma)
function f(k)
if k lt 2 then return k;
else return f(k-1) + k^(k-2)*f(k-2);
end if; return f;
end function;
A136680:= func< n, k | k le n select f(k) else 0 >;
[A136680(n, k): k in [1..n], n in [1..14]]; // G. C. Greubel, Dec 01 2022
(SageMath)
@CachedFunction
def f(k):
if (k<2): return k
else: return f(k-1) + k^(k-2)*f(k-2)
def A136680(n, k): return f(k) if (k < n+1) else 0
flatten([[A136680(n, k) for k in range(1, n+1)] for n in range(1, 15)]) # G. C. Greubel, Dec 01 2022
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, Apr 06 2008
EXTENSIONS
Edited by G. C. Greubel, Dec 01 2022
STATUS
approved