OFFSET
0,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,6,-2,-4).
FORMULA
From Colin Barker, Aug 20 2012: (Start)
a(n) = a(n-1) +6*a(n-2) -2*a(n-3) -4*a(n-4).
G.f.: (4-3*x-12*x^2+2*x^3)/((1-x)*(1+2*x)*(1-2*x-2*x^2)). (End)
MATHEMATICA
Simplify/@Table[(1+Sqrt[3])^n+(1-Sqrt[3])^n+1+(-2)^n, {n, 0, 30}] (* or *) LinearRecurrence[{1, 6, -2, -4}, {4, 1, 13, 13}, 30] (* Harvey P. Dale, Mar 12 2013 *)
PROG
def A215502(n) : return 1+(1+sqrt(3))^n+(-2)^n+(1-sqrt(3))^n
[A215502(i).round() for i in (0..28)]
(PARI) x='x+O('x^30); Vec((4-3*x-12*x^2+2*x^3)/((1-x)*(1+2*x)*(1-2*x-2*x^2))) \\ G. C. Greubel, Apr 23 2018
(Magma) [Round((1+Sqrt(3))^n + (-2)^n + (1-Sqrt(3))^n + 1): n in [0..30]]; // G. C. Greubel, Apr 23 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Peter Luschny, Aug 13 2012
STATUS
approved