A070512 a(n) = n^4 mod 7.
0, 1, 2, 4, 4, 2, 1, 0, 1, 2, 4, 4, 2, 1, 0, 1, 2, 4, 4, 2, 1, 0, 1, 2, 4, 4, 2, 1, 0, 1, 2, 4, 4, 2, 1, 0, 1, 2, 4, 4, 2, 1, 0, 1, 2, 4, 4, 2, 1, 0, 1, 2, 4, 4, 2, 1, 0, 1, 2, 4, 4, 2, 1, 0, 1, 2, 4, 4, 2, 1, 0, 1, 2, 4, 4, 2, 1, 0, 1, 2, 4, 4, 2, 1, 0, 1, 2, 4, 4, 2, 1, 0, 1, 2, 4, 4, 2, 1, 0, 1, 2
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0, 0, 0, 0, 0, 0, 1).
Programs
-
Magma
[Modexp(n, 4, 7): n in [0..100]]; // Vincenzo Librandi, Apr 02 2016
-
Mathematica
PowerMod[Range[0, 100], 4, 7] (* G. C. Greubel, Apr 01 2016 *)
-
PARI
a(n)=n^4%7 \\ Charles R Greathouse IV, Apr 06 2016
-
Sage
[power_mod(n,4,7)for n in range(0, 101)] # Zerinvary Lajos, Oct 30 2009
Formula
From G. C. Greubel, Apr 01 2016: (Start)
a(n) = a(n-7).
G.f.: x*(1 +2*x +4*x^2 +2*x^4 + x^5)/(1 - x^7). (End)
Comments