OFFSET
1,4
COMMENTS
This is very loosely based on the work of Kurlberg et al. It appears that a(n) = 1 at only six n: 1, 2, 3, 5, 11, 59.
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
Pär Kurlberg, Florian Luca, and Igor Shparlinski, On the fixed points of the map x -> x^x modulo a prime, arXiv 1402.4464
EXAMPLE
The simplest nontrivial case is n = 4. In this case, a(4) = 2 because there are two subsets: {0,1,2} and {3}. Note that 0^0 == 1 (mod 4), 1^1 == 1 (mod 4), 2^2 == 0 (mod 4), and 3^3 == 3 (mod 4).
MATHEMATICA
Table[toDo = Range[0, n-1]; sets = {}; While[Length[toDo] > 0, k = toDo[[1]]; toDo = Rest[toDo]; lst = {k}; While[q = PowerMod[k, k, n]; ! MemberQ[lst, q], AppendTo[lst, q]; toDo = Complement[toDo, {q}]; k = q]; AppendTo[sets, lst]]; Do[int = Intersection[sets[[i]], sets[[j]]]; If[int != {}, sets[[i]] = Union[sets[[i]], sets[[j]]]; sets[[j]] = {}], {i, Length[sets]}, {j, i+1, Length[sets]}]; Length[DeleteCases[sets, {}]], {n, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, Feb 19 2014
STATUS
approved