A185075 The number of distinct residues modulo n of {i^i: i=1,2...}.
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, 19, 18, 29, 21, 31, 18, 33, 26, 35, 18, 37, 29, 31, 24, 41, 23, 43, 28, 35, 35, 47, 27, 43, 32, 51, 33, 53, 29, 47, 33, 45, 44, 59, 36, 61, 47, 45, 34, 65, 45, 67
Offset: 1
Keywords
Links
- David W. Wilson, Table of n, a(n) for n = 1..10099
Programs
-
Mathematica
res[mod_] := Length[Union[Table[PowerMod[i,i,mod], {i, 1, mod + LCM[mod*CarmichaelLambda[mod]]}]]]; Table[res[n], {n, 100}]
-
PARI
period(n) = lcm(n, znstar(n)[2]); \\ A174824 a(n) = {v = []; for (i=1, period(n), v = Set(concat(v, Mod(i, n)^i));); #v;} \\ Michel Marcus, Mar 18 2016
Comments