login
A070353
a(n) = 3^n mod 14.
1
1, 3, 9, 13, 11, 5, 1, 3, 9, 13, 11, 5, 1, 3, 9, 13, 11, 5, 1, 3, 9, 13, 11, 5, 1, 3, 9, 13, 11, 5, 1, 3, 9, 13, 11, 5, 1, 3, 9, 13, 11, 5, 1, 3, 9, 13, 11, 5, 1, 3, 9, 13, 11, 5, 1, 3, 9, 13, 11, 5, 1, 3, 9, 13, 11, 5, 1, 3, 9, 13, 11, 5, 1, 3, 9, 13, 11, 5, 1, 3, 9, 13, 11, 5, 1, 3, 9, 13, 11, 5
OFFSET
0,2
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
Sequence in context: A045769 A262539 A101537 * A029458 A050571 A234286
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, May 12 2002
STATUS
approved