OFFSET
1,2
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..500
Index entries for linear recurrences with constant coefficients, signature (8,-26,44,-41,20,-4).
FORMULA
a(n) = 8*a(n-1) - 26*a(n-2) + 44*a(n-3) - 41*a(n-4) + 20*a(n-5) - 4*a(n-6).
G.f.: f(x)/g(x), where f(x) = x*(1 - 2*x^2) and g(x) = (1 - x)^4*(1 - 2*x)^2.
a(n) = 8 +(n-2)*2^(n+2) -(n-2)*n*(n+5)/6. - Bruno Berselli, Jul 09 2012
MATHEMATICA
(* First Program *)
b[n_]:= n; c[n_]:= -1 + 2^n;
t[n_, k_]:= Sum[b[k-i] c[n+i], {i, 0, k-1}]
TableForm[Table[t[n, k], {n, 1, 10}, {k, 1, 10}]]
Flatten[Table[t[n-k+1, k], {n, 12}, {k, n, 1, -1}]]
r[n_]:= Table[t[n, k], {k, 1, 60}] (* A213571 *)
d = Table[t[n, n], {n, 1, 40}] (* A213572 *)
s[n_]:= Sum[t[i, n+1-i], {i, 1, n}]
s1 = Table[s[n], {n, 1, 50}] (* A213581 *)
(* Second program *)
Table[2^(n+2)*(n-2) - (n^3+3*n^2-10*n-48)/6, {n, 35}] (* G. C. Greubel, Jul 26 2019 *)
PROG
(PARI) vector(35, n, 2^(n+2)*(n-2) - (n^3+3*n^2-10*n-48)/6) \\ G. C. Greubel, Jul 26 2019
(Magma) [2^(n+2)*(n-2) - (n^3+3*n^2-10*n-48)/6: n in [1..35]]; // G. C. Greubel, Jul 26 2019
(Sage) [2^(n+2)*(n-2) - (n^3+3*n^2-10*n-48)/6 for n in (1..35)] # G. C. Greubel, Jul 26 2019
(GAP) List([1..35], n-> 2^(n+2)*(n-2) - (n^3+3*n^2-10*n-48)/6); # G. C. Greubel, Jul 26 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jun 19 2012
STATUS
approved