| The only such n for 2 <= n <= 1000 are
{ 2, 4, 8, 16, 32, 64, 128, 256, 512 }
Dan
|
| Solution by David Hankin, John Dewey High School, New York.
The elements of M[n] will be a complete set of residues if, and only
if, [there are no solutions to]
C(x,2) is congruent to C(y,2) modulo n, 1 <= x < y <= n.
We will show this is the case if, and only if, n is a power of 2.
First, note that C(x,2) is congruent to C(y,2) modulo n if, and only
if, (y-x)(y+x-1) is congruent to 0 modulo 2n.
Suppose n is a power of 2; then so is 2n. Since y-x and y+x-1 are of
different parity and both are less than 2n, it is clear that 2n cannot
divide their product. Thus, M[n] must be a complete set of residues
modulo n.
Suppose n is not a power of 2, and write n = 2^e*m, where m is odd, m
>= 3 and e >= 0. Set y-x = min{2^(e+1),m} and y+x-1 = max{2^(e+1),m}.
Then y = (2^(e+1)+m+1)/2 and x = (abs(2^(e+1)-m)+1)/2. Then 1 <= x < y
<= n and from above, C(x,2) is congruent to C(y,2) modulo n.
|