OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (13, -48, 36).
FORMULA
a(1)=1, a(2)=13, a(n) = 12*a(n-1) - 36*a(n-2) + 1. - Vincenzo Librandi, Oct 23 2012
G.f.: x/((1-x)*(1-6*x)^2). - Vincenzo Librandi, Oct 23 2012
MAPLE
a:=n->sum (6^n-6^j, j=0..n): seq(a(n)/5, n=1..31); # Zerinvary Lajos, Dec 14 2008
MATHEMATICA
CoefficientList[Series[1/((1 - x)(1 - 6*x)^2), {x, 0, 40}], x] (* Vincenzo Librandi, Oct 23 2012 *)
nxt[{n_, a_}]:={n+1, (n+1*6^n+a}; Transpose[NestList[nxt, {1, 1}, 20]][[2]] (* or *) LinearRecurrence[{13, -48, 36}, {1, 13, 121}, 20] (* Harvey P. Dale, Apr 08 2014 *)
PROG
(Magma) I:=[1, 13]; [n le 2 select I[n] else 12*Self(n-1)-36*Self(n-2)+1: n in [1..30]]; // Vincenzo Librandi, Oct 23 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved