login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A070352
a(n) = 3^n mod 5; or period 4, repeat [1, 3, 4, 2].
6
1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, 1
OFFSET
0,2
COMMENTS
Residues mod 5 of Lucas numbers: for n>=1, a(n-1) = A000032(n) mod 5. - Clark Kimberling, Aug 28 2008
FORMULA
From R. J. Mathar, Apr 13 2010: (Start)
a(n) = a(n-1) - a(n-2) + a(n-3) for n>2.
G.f.: (1+2*x+2*x^2) / ((1-x)*(1+x^2)). (End)
a(n) = 2^(3*n) mod 5. - Gary Detlefs, May 18 2014
E.g.f.: (1/2)*(5*exp(x) + sin(x) - 3*cos(x)). - G. C. Greubel, Mar 11 2016
a(n) = a(n-4) for n>3. - Wesley Ivan Hurt, Jul 09 2016
MAPLE
seq(op([1, 3, 4, 2]), n=0..50); # Wesley Ivan Hurt, Jul 09 2016
MATHEMATICA
Table[PowerMod[3, n, 5], {n, 0, 200}] (* Vladimir Joseph Stephan Orlovsky, Jun 10 2011 *)
PROG
(Sage) [power_mod(2, -n, 5) for n in range(0, 101)] # Zerinvary Lajos, Jun 08 2009
(Magma) &cat [[1, 3, 4, 2]^^27]; // Bruno Berselli, Dec 10 2015
(Magma) [Modexp(3, n, 5): n in [0..100]]; // Bruno Berselli, Mar 23 2016
(PARI) a(n) = lift(Mod(3, 5)^n); \\ Michel Marcus, Mar 16 2016
CROSSREFS
Cf. A000032. - Clark Kimberling, Aug 28 2008
Sequence in context: A238570 A145425 A201909 * A227216 A239678 A136374
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, May 12 2002
STATUS
approved