OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..200
Index entries for linear recurrences with constant coefficients, signature (5,-4).
FORMULA
G.f.: 16*x^2/((1-x)*(1-4*x)).
a(n) = a(n-1) + 4^n = (4^(n+1) - 16)/3 = 5*a(n-1) - 4*a(n-2).
a(n) = A080674(n) - 4. - Michel Marcus, Sep 25 2014
MATHEMATICA
RecurrenceTable[{a[1] == 0, a[n] == a[n-1] + 4^n}, a, {n, 30}] (* or *) CoefficientList[ Series[16 x / ((1 - x) (1 - 4 x)), {x, 0, 40}], x]
LinearRecurrence[{5, -4}, {0, 16}, 30] (* Harvey P. Dale, Feb 19 2023 *)
PROG
(Magma) [0] cat [&+[4^k: k in [2..n]]: n in [2..30]]; /* or */ [(4^(n+1)-16)/3: n in [1..30]];
(PARI) a(n) = sum(k=2, n, 4^k); \\ Michel Marcus, Sep 25 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Sep 25 2014
STATUS
approved