A135399 a(n) = (-1)^n + (-2)^n + 3^n (-1, -2 and 3 are the roots of the equation x^3 = 7*x + 6).
3, 0, 14, 18, 98, 210, 794, 2058, 6818, 19170, 60074, 175098, 535538, 1586130, 4799354, 14316138, 43112258, 129009090, 387682634, 1161737178, 3487832978, 10458256050, 31385253914, 94134790218, 282446313698, 847255055010, 2541932937194, 7625463267258
Offset: 0
Examples
a(3) = (-1)^3 + (-2)^3 + 3^3 = -1 - 8 + 27 = 18.
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (0,7,6).
Programs
-
Mathematica
Table[(-1)^n+(-2)^n+3^n,{n,0,30}] (* or *) LinearRecurrence[{0,7,6},{3,0,14},30] (* Harvey P. Dale, Oct 18 2015 *)
-
PARI
a(n)=(-1)^n + (-2)^n + 3^n \\ Charles R Greathouse IV, Oct 12 2016
Formula
G.f.: (3 - 7*x^2)/(1-7*x^2-6*x^3).
E.g.f.: exp(-x) + exp(-2*x) + exp(3*x)
a(0)=3, a(1)=0, a(2)=14, a(n) = 7*a(n-2) + 6*a(n-3). - Harvey P. Dale, Oct 18 2015
Comments