OFFSET
0,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000 (* extending prior file from Vincenzo Librandi *)
Index entries for linear recurrences with constant coefficients, signature (7, -14, 8).
FORMULA
a(n) = (10*4^n - 9*2^n + 2)/3.
G.f.: (1+x)/((1-x)*(1-2*x)*(1-4*x)).
a(0)=1, a(1)=8, a(2)=42, a(n) = 7*a(n-1) - 14*a(n-2) + 8*a(n-3). - Harvey P. Dale, May 04 2012
a(n) = A203241(n+1) + 2^n*(2^(n+1)-1), n>0. - J. M. Bergot, Mar 21 2018
MAPLE
a:= proc(n) option remember: if n = 0 then 1 elif n = 1 then 8 elif n >= 2 then 6*procname(n-1) - 8*procname(n-2) + 2 fi; end:
seq(a(n), n = 0..25); # Muniru A Asiru, Mar 22 2018
MATHEMATICA
RecurrenceTable[{a[0]==1, a[1]==8, a[n]==6a[n-1]-8a[n-2]+2}, a, {n, 30}] (* or *) LinearRecurrence[{7, -14, 8}, {1, 8, 42}, 30] (* Harvey P. Dale, May 04 2012 *)
PROG
(PARI) {m=23; v=concat([1, 8], vector(m-2)); for(n=3, m, v[n]=6*v[n-1]-8*v[n-2]+2); v}
(Magma) [(10*4^n-9*2^n+2)/3: n in [0..30]]; // Vincenzo Librandi, Jul 18 2011
(GAP) a:=[1, 8];; for n in [3..25] do a[n]:=6*a[n-1]-8*a[n-2]+2; od; a; # Muniru A Asiru, Mar 22 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Klaus Brockhaus, Dec 09 2009
STATUS
approved