A070514 Final digit of n^4: a(n) = n^4 mod 10.
0, 1, 6, 1, 6, 5, 6, 1, 6, 1, 0, 1, 6, 1, 6, 5, 6, 1, 6, 1, 0, 1, 6, 1, 6, 5, 6, 1, 6, 1, 0, 1, 6, 1, 6, 5, 6, 1, 6, 1, 0, 1, 6, 1, 6, 5, 6, 1, 6, 1, 0, 1, 6, 1, 6, 5, 6, 1, 6, 1, 0, 1, 6, 1, 6, 5, 6, 1, 6, 1, 0, 1, 6, 1, 6, 5, 6, 1, 6, 1, 0, 1, 6, 1, 6, 5, 6, 1, 6, 1, 0, 1, 6, 1, 6, 5, 6, 1, 6, 1, 0
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0, 0, 0, 0, 0, 0, 0, 0, 0, 1).
Programs
-
Magma
[n^4 mod (10): n in [0..80]]; // Vincenzo Librandi, Jun 16 2015
-
Maple
A070514:=n->n^4 mod 10: seq(A070514(n), n=0..100); # Wesley Ivan Hurt, Apr 01 2016
-
Mathematica
LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {0, 1, 6, 1, 6, 5, 6, 1, 6, 1}, 100] (* Vincenzo Librandi, Jun 16 2015 *) PowerMod[Range[0, 100], 4, 10] (* G. C. Greubel, Apr 01 2016 *)
-
PARI
vector(100,n,n--;n^4%10) \\ Derek Orr, Jun 16 2015
-
Sage
[power_mod(n,4,10)for n in range(0, 101)] # Zerinvary Lajos, Oct 30 2009
Formula
a(n) = n^k mod 10; for k > 0 where k mod 4 = 0. - Doug Bell, Jun 15 2015
From G. C. Greubel, Apr 01 2016: (Start)
a(n) = a(n-10).
a(2*n) = 6*A011558(n).
G.f.: (x +6*x^2 +x^3 +6*x^4 +5*x^5 +6*x^6 +x^7 +6*x^8 +x^9)/(1 - x^10). (End)
Comments