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
a(n) = n^6 mod 10. - Zerinvary Lajos, Nov 06 2009
Decimal expansion of 166285490/1111111111. - Alexander R. Povolotsky, Mar 09 2013
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0, 0, 0, 0, 0, 0, 0, 0, 0, 1).
FORMULA
Periodic with period 10. - Franklin T. Adams-Watters, Mar 13 2006
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^2 - 10*floor(n^2/10). - Wesley Ivan Hurt, Jun 12 2013
a(n) = A033569(n+3) mod 10. - Wesley Ivan Hurt, Dec 06 2014
a(n) = n^k mod 10; for k > 0 where k mod 4 = 2. - Doug Bell, Jun 15 2015
MAPLE
MATHEMATICA
Table[Mod[n^2, 10], {n, 0, 200}] (* Vladimir Joseph Stephan Orlovsky, Apr 21 2011 *)
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
(Magma) [n^2 - 10*Floor(n^2/10): n in [0..80]]; // Vincenzo Librandi, Jun 16 2015
(PARI) a(n)=n^2%10 \\ Charles R Greathouse IV, Sep 24 2015
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
N. J. A. Sloane, Mar 15 1996
STATUS
approved