login
n^n (mod 5).
2

%I #18 Aug 26 2015 10:12:07

%S 1,1,4,2,1,0,1,3,1,4,0,1,1,3,1,0,1,2,4,4,0,1,4,2,1,0,1,3,1,4,0,1,1,3,

%T 1,0,1,2,4,4,0,1,4,2,1,0,1,3,1,4,0,1,1,3,1,0,1,2,4,4,0,1,4,2,1,0,1,3,

%U 1,4,0,1,1,3,1,0,1,2,4,4,0,1,4,2,1,0,1

%N n^n (mod 5).

%C For n>0, periodic with period 20 = A174824(5): repeat [1, 4, 2, 1, 0, 1, 3, 1, 4, 0, 1, 1, 3, 1, 0, 1, 2, 4, 4, 0].

%H <a href="/index/Rec#order_20">Index entries for linear recurrences with constant coefficients</a>, signature (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1).

%t Table[PowerMod[n,n,5], {n,0,140}]

%t Join[{1},LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},{1, 4, 2, 1, 0, 1, 3, 1, 4, 0, 1, 1, 3, 1, 0, 1, 2, 4, 4, 0},86]] (* _Ray Chandler_, Aug 26 2015 *)

%Y Cf. A204689, A174824.

%K nonn,easy

%O 0,3

%A _José María Grau Ribas_, Jan 18 2012