A070368 a(n) = 5^n mod 13.
1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1, 5, 12, 8, 1
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (1,-1,1).
Crossrefs
Cf. A000351.
Programs
-
Magma
[Modexp(5, n, 13): n in [0..100]]; // Vincenzo Librandi, Jun 29 2016
-
Maple
seq(op([1, 5, 12, 8]), n=0..50); # Wesley Ivan Hurt, Jul 06 2016
-
Mathematica
Table[Mod[5^n, 13], {n, 0, 100}] (* G. C. Greubel, Mar 05 2016 *) PowerMod[5,Range[0,100],13] (* or *) PadRight[{},100,{1,5,12,8}] (* Harvey P. Dale, Jul 03 2019 *)
-
PARI
a(n)=lift(Mod(5,13)^n) \\ Charles R Greathouse IV, Mar 22 2016
-
Sage
[power_mod(5,n,13) for n in range(0,93)] # Zerinvary Lajos, Nov 25 2009
Formula
From R. J. Mathar, Apr 20 2010: (Start)
a(n) = a(n-1) - a(n-2) + a(n-3) for n>2.
G.f.: ( 1+4*x+8*x^2 ) / ( (1-x)*(1+x^2) ). (End)
a(n) = (26-(11+3*I)*(-I)^n-(11-3*I)*I^n)/4. - Bruno Berselli, Feb 07 2011
From G. C. Greubel, Mar 05 2016: (Start)
a(n) = a(n-4) for n>3.
E.g.f.: (1/2)*(13*cosh(x) + 13*sinh(x) - 11*cos(x) - 3*sin(x)). (End)
Comments