OFFSET
1,2
COMMENTS
The values of x can be taken to be 1 to n.
Properties of the sequence: if n prime, a(n) = n and a(n+1) = 2n because x^n == 0,1,2,3,...,n-1 (mod n) and x^(2n) == 0, 1^2, 2^2, 3^2,...,(n-1)^2, n (mod 2n) with n+1 distinct residues.
There exists prime numbers, for example n = 7, 19, 37,... with the property: a(n) = n, a(n+1) = 2n, and a(n+2) = 3n.
There exists composite numbers, for example n = 15, 33, 35, 51,... with the property a(n) = n.
LINKS
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.
FORMULA
a(n) such that A195637(a(n)) = n.
EXAMPLE
a(6) = 10 because x^10 == 0, 1, 4, 5, 6, 9 (mod 10) => 6 distinct residues.
MAPLE
a:= nops ({seq (k&^n mod n, k=0..n-1)}):for i from 1 to 60 do:id:=0:for j from 1 to 10000 while(id=0) do:if a(j)=i then id:=1:printf ( "%d %d \n", i, j):else fi:od:od:
MATHEMATICA
nn = 10000; t = Table[Length[Union[PowerMod[Range[n], n, n]]], {n, nn}]; lim = Complement[Range[nn], Union[t]][[1]] - 1; Table[Position[t, n, 1, 1][[1, 1]], {n, lim}] (* T. D. Noe, Oct 03 2011 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Oct 01 2011
STATUS
approved