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”).

The number of distinct residues modulo n of {i^i: i=1,2...}.
1

%I #17 Mar 18 2016 05:44:09

%S 1,2,3,3,5,5,7,6,7,8,11,8,13,11,15,10,17,11,19,13,17,17,23,15,21,20,

%T 19,18,29,21,31,18,33,26,35,18,37,29,31,24,41,23,43,28,35,35,47,27,43,

%U 32,51,33,53,29,47,33,45,44,59,36,61,47,45,34,65,45,67

%N The number of distinct residues modulo n of {i^i: i=1,2...}.

%H David W. Wilson, <a href="/A185075/b185075.txt">Table of n, a(n) for n = 1..10099</a>

%t res[mod_] := Length[Union[Table[PowerMod[i,i,mod], {i, 1, mod + LCM[mod*CarmichaelLambda[mod]]}]]]; Table[res[n], {n, 100}]

%o (PARI) period(n) = lcm(n, znstar(n)[2]); \\ A174824

%o a(n) = {v = []; for (i=1, period(n), v = Set(concat(v, Mod(i, n)^i));); #v;} \\ _Michel Marcus_, Mar 18 2016

%Y Cf. A000312, A174824.

%K nonn

%O 1,2

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