This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A204688 #50 Sep 08 2022 08:46:01 %S A204688 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, %T A204688 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, %U A204688 1,0,1,2,0,1,1,0,1,2,0,1,1,0,1,2,0,1,1 %N A204688 a(n) = n^n (mod 3). %C A204688 For n>0, a(n) is periodic with period 6: repeat [1, 1, 0, 1, 2, 0]. %C A204688 Decimal expansion of 1110119/9999990. - _David A. Corneth_, Jun 28 2016 %H A204688 José María Grau and Antonio M. Oller-Marcén, <a href="http://arxiv.org/abs/1203.4066">On the last digit and the last non-zero digit of n^n in base b</a>, arXiv preprint arXiv:1203.4066 [math.NT], 2012. %H A204688 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,1). %F A204688 G.f.: (1+x+x^2+x^4+2*x^5-x^6) / (1-x^6). - _Bruno Berselli_, Jan 18 2012 %F A204688 From _Wesley Ivan Hurt_, Jun 28 2016: (Start) %F A204688 a(n) = a(n-6) for n>6. %F A204688 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) %F A204688 a(n) = A010872(A000312(n)). - _Michel Marcus_, Jun 28 2016 %p A204688 A204688:=n->power(n,n) mod 3: 1, seq(A204688(n), n=1..100); # _Wesley Ivan Hurt_, Jun 28 2016 %t A204688 Table[PowerMod[n,n,3], {n,0,140}] %o A204688 (Magma) [1] cat [Modexp(n, n, 3): n in [1..100]]; // _Wesley Ivan Hurt_, Jun 28 2016 %Y A204688 Cf. A000312, A010872, A174824. %K A204688 nonn,easy %O A204688 0,6 %A A204688 _José María Grau Ribas_, Jan 18 2012