cp's OEIS Frontend

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.

A204689 a(n) = n^n (mod 4).

This page as a plain text file.
%I A204689 #37 Sep 08 2022 08:46:01
%S A204689 1,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,
%T A204689 0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,
%U A204689 0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0
%N A204689 a(n) = n^n (mod 4).
%C A204689 Apart from a(0), the same as A109718. [_Joerg Arndt_, Sep 17 2013]
%C A204689 Periodic for n>0 with period 4 = A174824(4): repeat [1, 0, 3, 0].
%H A204689 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,1).
%F A204689 From _Bruno Berselli_, Jan 18 2012: (Start)
%F A204689 G.f.: (1+x+3x^3-x^4)/(1-x^4).
%F A204689 a(n) = (1-(-1)^n)*(2+i^(n+1))/2 with i=sqrt(-1), a(0)=1.
%F A204689 a(n) = A109718(n) for n>0. (End)
%F A204689 a(2k) = A000007(k), a(2k+1) = A010684(k). - _Wesley Ivan Hurt_, Jun 15 2016
%p A204689 A204689:=n->n^n mod 4: seq(A204689(n), n=0..150); # _Wesley Ivan Hurt_, Jun 15 2016
%t A204689 Table[PowerMod[n, n, 4], {n,0,140}]
%o A204689 (Magma) [1] cat &cat [[1, 0, 3, 0]^^30]; // _Wesley Ivan Hurt_, Jun 15 2016
%Y A204689 Cf. A000007, A010684, A109718, A174824.
%K A204689 nonn,easy
%O A204689 0,4
%A A204689 _José María Grau Ribas_, Jan 18 2012