OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..1000
MAPLE
udivs:= proc(n) local t, F;
F:= map(t -> t[1]^t[2], ifactors(n)[2]);
map(convert, combinat:-powerset(F), `*`);
end proc:
filter:= proc(n) local t, U;
convert(map(t -> (t &^ n) mod n, udivs(n)), `+`) mod n = 0
end proc:
select(filter, [$1..20000]); # Robert Israel, Dec 07 2022
MATHEMATICA
AA[n_, k_] := AA[n, k] = Mod[Sum[If[GCD[i, n] == i && GCD[i, n/i] == 1, PowerMod[i, k, n], 0], {i, n}], n]; Select[Range[1000], Mod[AA[#, #], #] == 0 &]
CROSSREFS
KEYWORD
nonn
AUTHOR
José María Grau Ribas, Mar 07 2014
STATUS
approved