OFFSET
1,3
COMMENTS
If n = prime(k), then a(n) = k.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
I. M. Vinogradov, On a general theorem concerning the distribution of the residues and non-residues of powers, Trans. American Math. Soc., 29 (1927), 209-217.
EXAMPLE
a(11) = a(prime(5)) = 5, and we check: 2^11, 3^11, 5^11, 7^11, 11^11 == 2, 3, 5, 7, 0 (mod 11) respectively => 5 distinct residues;
a(18) = 3 because 2^18, 3^18, 5^18, 7^18, 11^18, 13^18, 17^18 == 10, 9, 1, 1, 1, 1, 1 (mod 18) respectively => 3 distinct residues.
MAPLE
a:= proc(n) local p, s; s:= {}; p:=2; while p<=n do s:= s union {p&^n mod n}; p:= nextprime(p) od; nops(s) end: seq(a(n), n=1..100);
MATHEMATICA
a[n_] := PowerMod[#, n, n]& /@ Prime[Range[PrimePi[n]]] // Union // Length;
Array[a, 100] (* Jean-François Alcover, Nov 20 2020 *)
PROG
(PARI) a(n) = #Set(vector(primepi(n), k, Mod(prime(k), n)^n)); \\ Michel Marcus, Nov 20 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Sep 23 2011
STATUS
approved