OFFSET
1,1
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,9,-9).
FORMULA
a(n) = 10*9^((n-1)/2)-2 (n odd), 2*9^(n/2)-2 (n even).
a(1)=0, a(2)=8, a(3)=16, a(n)=a(n-1)+9*a(n-2)-9*a(n-3). - Harvey P. Dale, Jul 17 2012
G.f.: 8*x*(x+1) / ((x-1)*(3*x-1)*(3*x+1)). - Colin Barker, Apr 26 2015
a(n) = 8 * 3^(n-1) + 2 * (-3)^(n-1) - 2. - Robert Israel, Apr 26 2015
MAPLE
seq( 8 * 3^(n-1) + 2 * (-3)^(n-1) - 2, n=1..100); # Robert Israel, Apr 26 2015
MATHEMATICA
Table[If[OddQ[n], 10*9^((n-1)/2)-2, 2*9^(n/2)-2], {n, 0, 30}] (* or *) LinearRecurrence[ {1, 9, -9}, {0, 8, 16}, 30] (* Harvey P. Dale, Jul 17 2012 *)
PROG
(PARI) Vec(8*x*(x+1)/((x-1)*(3*x-1)*(3*x+1)) + O(x^100)) \\ Colin Barker, Apr 26 2015
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Martin Renner, May 02 2006
EXTENSIONS
More terms from Harvey P. Dale, Jul 17 2012
STATUS
approved