OFFSET
1,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,7,-7).
FORMULA
a(n) = 8*7^((n-1)/2)-2 (n odd), 2*7^(n/2)-2 (n even).
G.f.: 6*x*(x+1) / ((x-1)*(7*x^2-1)). - Colin Barker, Feb 15 2013
From G. C. Greubel, Oct 27 2016: (Start)
a(n) = a(n-1) + 7*a(n-2) - 7*a(n-3).
a(n) = (1/sqrt(7))*(-2*sqrt(7) + 7^((n+1)/2) + (-1)^n*7^((n+1)/2) + 4*7^(n/2) - 4*(-1)^n*7^(n/2)).
E.g.f.: (1/sqrt(7))*( (sqrt(7) - 4)*exp(-sqrt(7)*x) + (4 + sqrt(7))*exp(sqrt(7)*x) - 2*sqrt(7)*exp(x)). (End)
MATHEMATICA
Table[If[OddQ[n], 8*7^((n-1)/2)-2, 2*7^(n/2)-2], {n, 30}] (* or *) LinearRecurrence[{1, 7, -7}, {6, 12, 54}, 30] (* Harvey P. Dale, Oct 31 2013 *)
Rest@ CoefficientList[Series[6 x (x + 1)/((x - 1) (7 x^2 - 1)), {x, 0, 28}], x] (* Michael De Vlieger, Oct 31 2016 *)
PROG
(Magma) [IsOdd(n) select 8*7^((n-1) div 2)-2 else 2*7^(n div 2)-2: n in [1..30]]; // Vincenzo Librandi, Oct 29 2016
(PARI) a(n)=([0, 1, 0; 0, 0, 1; -7, 7, 1]^(n-1)*[6; 12; 54])[1, 1] \\ Charles R Greathouse IV, Oct 31 2016
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Martin Renner, May 02 2006
EXTENSIONS
More terms from Colin Barker, Feb 15 2013
STATUS
approved