|
|
A008959
|
|
Final digit of squares: a(n) = n^2 mod 10.
|
|
20
|
|
|
0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
a(m*n) = a(m)*a(n) mod 10; a(5*n+k) = a(5*n-k) for k <= 5*n. - Reinhard Zumkeller, Apr 24 2009
|
|
LINKS
|
Index entries for linear recurrences with constant coefficients, signature (0, 0, 0, 0, 0, 0, 0, 0, 0, 1).
|
|
FORMULA
|
a(n) = 4.5 - (1 + 5^(1/2))*cos(Pi*n/5) + (-1 - 3/5*5^(1/2))*cos(2*Pi*n/5) + (5^(1/2) - 1)*cos(3*Pi*n/5) + (-1 + 3/5*5^(1/2))*cos(4*Pi*n/5) - 0.5*(-1)^n. - Richard Choulet, Dec 12 2008
G.f.: (x^9+4*x^8+9*x^7+6*x^6+5*x^5+6*x^4+9*x^3+4*x^2+x)/(-x^10+1). - Colin Barker, Aug 14 2012
a(n) = n^k mod 10; for k > 0 where k mod 4 = 2. - Doug Bell, Jun 15 2015
|
|
MAPLE
|
|
|
MATHEMATICA
|
PowerMod[Range[0, 80], 2, 10] (* or *) LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {0, 1, 4, 9, 6, 5, 6, 9, 4, 1}, 120] (* Harvey P. Dale, Oct 16 2012 *)
|
|
PROG
|
(Sage) [power_mod(n, 2, 10) for n in range(0, 81)] # Zerinvary Lajos, Nov 06 2009
(Magma) [0] cat [Intseq(n^2)[1]: n in [1..80]]; // Bruno Berselli, Feb 14 2013
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|