OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,-2,1).
FORMULA
From R. J. Mathar, Apr 13 2010: (Start)
a(n) = 2*a(n-1) - 2*a(n-2) + a(n-3).
G.f.: (1+x+5*x^2) / ((1-x)*(x^2-x+1)). (End)
E.g.f.: 7*exp(x) - (2/sqrt(3))*exp(x/2)*sin(sqrt(3)*x/2) - 6*exp(x/2)*cos(sqrt(3)*x/2). - G. C. Greubel, Mar 11 2016
MATHEMATICA
PowerMod[3, Range[0, 90], 14] (* or *) LinearRecurrence[{2, -2, 1}, {1, 3, 9}, 90] (* Harvey P. Dale, Jul 12 2014 *)
PROG
(Sage) [power_mod(3, n, 14) for n in range(0, 90)] # Zerinvary Lajos, Nov 24 2009
(PARI) a(n)=lift(Mod(3, 14)^n) \\ Charles R Greathouse IV, Mar 22 2016
(Magma) [Modexp(3, n, 14): n in [0..100]]; // Bruno Berselli, Mar 23 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, May 12 2002
STATUS
approved