OFFSET
0,3
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,3,-8,4).
FORMULA
a(2n) = (1/9)*(7*4^n+6*n+2); a(2n+1) = (1/9)*(4*4^n+6*n+5).
a(n) = 2*a(n-1)+3*a(n-2)-8*a(n-3)+4*a(n-4). G.f.: (x^2+x-1) / ((x-1)^2*(2*x-1)*(2*x+1)). - Colin Barker, Jun 26 2013
MATHEMATICA
RecurrenceTable[{a[0]==1, a[n]==2^n+n-2a[n-1]}, a, {n, 40}] (* or *) LinearRecurrence[{2, 3, -8, 4}, {1, 1, 4, 3}, 40] (* Harvey P. Dale, Mar 09 2014 *)
PROG
(PARI) a(n)=if(n<1, 1, 2^n+n-2*a(n-1))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Benoit Cloitre, Apr 13 2003
STATUS
approved