|
|
A027219
|
|
a(n) = Sum_{k=0..n} (k+1) * A026736(n,k).
|
|
1
|
|
|
1, 3, 8, 20, 50, 117, 283, 639, 1512, 3338, 7774, 16898, 38884, 83566, 190488, 405848, 918120, 1942813, 4367665, 9191499, 20555546, 43061789, 95874233, 200083005, 443770612, 923124007, 2040635445, 4233080627, 9330343290
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
MATHEMATICA
|
T[n_, k_]:= T[n, k] = If[k==0 || k==n, 1, If[EvenQ[n] && k==(n-2)/2, T[n-1, k-1] + T[n-2, k-1] + T[n-1, k], T[n-1, k-1] + T[n-1, k]]]; Table[Sum[(k+1)*T[n, k], {k, 0, n}], {n, 0, 30}] (* G. C. Greubel, Jul 19 2019 *)
|
|
PROG
|
(PARI) T(n, k) = if(k==n || k==0, 1, k==n-1, n, if((n%2)==0 && k==(n-2)/2, T(n-1, k-1) + T(n-2, k-1) + T(n-1, k), T(n-1, k-1) + T(n-1, k) ));
vector(20, n, n--; sum(k=0, n, (k+1)*T(n, k)) ) \\ G. C. Greubel, Jul 19 2019
(Sage)
@CachedFunction
def T(n, k):
if (k==0 or k==n): return 1
elif (mod(n, 2)==0 and k==(n-2)/2): return T(n-1, k-1) + T(n-2, k-1)
+ T(n-1, k)
else: return T(n-1, k-1) + T(n-1, k)
[sum((k+1)*T(n, k) for k in (0..n)) for n in (0..30)] # G. C. Greubel, Jul 19 2019
(GAP)
T:= function(n, k)
if k=0 or k=n then return 1;
elif k=n-1 then return n;
elif (n mod 2)=0 and k=Int((n-2)/2) then return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k);
else return T(n-1, k-1) + T(n-1, k);
fi;
end;
List([0..20], n-> Sum([0..n], k-> (k+1)*T(n, k) )); # G. C. Greubel, Jul 19 2019
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|