login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A204689
a(n) = n^n (mod 4).
3
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, 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, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0
OFFSET
0,4
COMMENTS
Apart from a(0), the same as A109718. [Joerg Arndt, Sep 17 2013]
Periodic for n>0 with period 4 = A174824(4): repeat [1, 0, 3, 0].
FORMULA
From Bruno Berselli, Jan 18 2012: (Start)
G.f.: (1+x+3x^3-x^4)/(1-x^4).
a(n) = (1-(-1)^n)*(2+i^(n+1))/2 with i=sqrt(-1), a(0)=1.
a(n) = A109718(n) for n>0. (End)
a(2k) = A000007(k), a(2k+1) = A010684(k). - Wesley Ivan Hurt, Jun 15 2016
MAPLE
A204689:=n->n^n mod 4: seq(A204689(n), n=0..150); # Wesley Ivan Hurt, Jun 15 2016
MATHEMATICA
Table[PowerMod[n, n, 4], {n, 0, 140}]
PROG
(Magma) [1] cat &cat [[1, 0, 3, 0]^^30]; // Wesley Ivan Hurt, Jun 15 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved