A070365 a(n) = 5^n mod 7.
1, 5, 4, 6, 2, 3, 1, 5, 4, 6, 2, 3, 1, 5, 4, 6, 2, 3, 1, 5, 4, 6, 2, 3, 1, 5, 4, 6, 2, 3, 1, 5, 4, 6, 2, 3, 1, 5, 4, 6, 2, 3, 1, 5, 4, 6, 2, 3, 1, 5, 4, 6, 2, 3, 1, 5, 4, 6, 2, 3, 1, 5, 4, 6, 2, 3, 1, 5, 4, 6, 2, 3, 1, 5, 4, 6, 2, 3, 1, 5, 4, 6, 2, 3, 1, 5, 4, 6, 2, 3, 1, 5, 4, 6, 2, 3, 1, 5, 4, 6, 2
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,0,-1,1).
Crossrefs
Programs
-
Magma
[Modexp(5, n, 7): n in [0..100]]; // Vincenzo Librandi, Mar 24 2016 - after Bruno Berselli
-
Maple
A070365:=n->[1, 5, 4, 6, 2, 3][(n mod 6)+1]: seq(A070365(n), n=0..100); # Wesley Ivan Hurt, Jun 23 2016
-
Mathematica
PowerMod[5, Range[0, 110], 7] (* or *) LinearRecurrence[{1, 0, -1, 1}, {1, 5, 4, 6}, 110] (* Harvey P. Dale, Apr 26 2011 *) Table[Mod[5^n, 7], {n, 0, 100}] (* G. C. Greubel, Mar 05 2016 *) PadRight[{}, 100, {1, 5, 4, 6, 2, 3}] (* or *) CoefficientList[Series[(1 + 5 x + 4 x^2 + 6 x^3 + 2 x^4 + 3 x^5) / (1 - x^6), {x, 0, 100}], x] (* Vincenzo Librandi, Mar 24 2016 *)
-
PARI
a(n)=lift(Mod(5,7)^n) \\ Charles R Greathouse IV, Mar 22 2016
Formula
From R. J. Mathar, Apr 13 2010: (Start)
a(n) = a(n-1) - a(n-3) + a(n-4) for n>3.
G.f.: (1+4*x-x^2+3*x^3)/ ((1-x)*(1+x)*(x^2-x+1)). (End)
From Klaus Brockhaus, May 23 2010: (Start)
a(n+1)-a(n) = A178141(n).
a(n+2)-a(n) = A117373(n+5). (End)
From G. C. Greubel, Mar 05 2016: (Start)
a(n) = a(n-6) for n>5.
E.g.f.: (1/3)*(7*cosh(x) + 14*sinh(x) + 2*sqrt(3)*exp(x/2)*sin(sqrt(3)*x/2) - 4*exp(x/2)*cos(sqrt(3)*x/2)). (End)
a(n) = (21 - 7*cos(n*Pi) - 8*cos(n*Pi/3) + 4*sqrt(3)*sin(n*Pi/3))/6. - Wesley Ivan Hurt, Jun 23 2016
Comments