A204688 a(n) = n^n (mod 3).
1, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1
Offset: 0
Links
- José María Grau and Antonio M. Oller-Marcén, On the last digit and the last non-zero digit of n^n in base b, arXiv preprint arXiv:1203.4066 [math.NT], 2012.
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,1).
Programs
-
Magma
[1] cat [Modexp(n, n, 3): n in [1..100]]; // Wesley Ivan Hurt, Jun 28 2016
-
Maple
A204688:=n->power(n,n) mod 3: 1, seq(A204688(n), n=1..100); # Wesley Ivan Hurt, Jun 28 2016
-
Mathematica
Table[PowerMod[n,n,3], {n,0,140}]
Formula
G.f.: (1+x+x^2+x^4+2*x^5-x^6) / (1-x^6). - Bruno Berselli, Jan 18 2012
From Wesley Ivan Hurt, Jun 28 2016: (Start)
a(n) = a(n-6) for n>6.
a(n) = sin(n*Pi/3) * (10*sin(n*Pi/3) + 2*sin(2*n*Pi/3) - sqrt(3) - 2*sqrt(3)*cos(n*Pi/3))/6 for n>0. (End)
Comments