OFFSET
1,2
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (7,-19,25,-16,4).
FORMULA
a(n) = 7*a(n-1) - 19*a(n-2) + 25*a(n-3) - 16*a(n-4) + 4*a(n-5).
G.f.: x*(1 + 2*x - 6*x^2) / ((1 - x)^3*(1 - 2*x)^2).
a(n) = (n+1)*(2^(n+2) - 3*n -4)/2. - Colin Barker, Nov 04 2017
E.g.f.: (4*(1+2*x)*exp(2*x) - (3*x^2+10*x+4)*exp(x))/2. - G. C. Greubel, Jul 08 2019
MATHEMATICA
(* First program *)
b[n_]:= 2^n - 1; c[n_]:= 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}]] (* A213582 *)
r[n_]:= Table[T[n, k], {k, 40}] (* columns of antidiagonal triangle *)
Table[T[n, n], {n, 1, 40}] (* A213583 *)
s[n_]:= Sum[T[i, n+1-i], {i, 1, n}]
Table[s[n], {n, 1, 50}] (* A156928 *)
(* Second program *)
LinearRecurrence[{7, -19, 25, -16, 4}, {1, 9, 38, 120, 327}, 40] (* Harvey P. Dale, Apr 06 2013 *)
Table[(n+1)*(2^(n+2)-3*n-4)/2, {n, 40}] (* G. C. Greubel, Jul 08 2019 *)
PROG
(PARI) Vec(x*(1 + 2*x - 6*x^2) / ((1 - x)^3*(1 - 2*x)^2) + O(x^40)) \\ Colin Barker, Nov 04 2017
(PARI) vector(40, n, (n+1)*(2^(n+2) -3*n-4)/2) \\ G. C. Greubel, Jul 08 2019
(Magma) [(n+1)*(2^(n+2) -3*n-4)/2: n in [1..40]]; // G. C. Greubel, Jul 08 2019
(Sage) [(n+1)*(2^(n+2) -3*n-4)/2 for n in (1..40)] # G. C. Greubel, Jul 08 2019
(GAP) List([1..40], n-> (n+1)*(2^(n+2) -3*n-4)/2) # G. C. Greubel, Jul 08 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jun 19 2012
STATUS
approved