The answer is the first choice.
We know that this is the case because this set has n - 1 elements.
We also know that there are no duplicates in this set,
because we know that n is prime and a is not divisible by n.
That means that this will generate the numbers 1 through n - 1 in some order,
some permutation of those, but since it's a set, it's the same as the set 1 through n -1.
This turns out to be a useful property for proving Fermat's Little Theorem,
because we can set these two things as equal
and multiply all the elements in those sets.
Since we know they're the same set, we know that their products are also equal.
This product is (n - 1)!.
Since the sets contain the same elements, we know their products also must be equal.
So this is the product of the first set. This is the product of the second set.
It's (n - 1)!, because it's multiplying all those numbers up to n - 1, and mod n--those must be equal.
We took the mod n out of each of these terms, but that's fine.
Then we can simplify this, taking out the a's.
If we take out all the a's what we have is (1  2  3  ...  n - 1)a still equal to (n - 1)! mod n.
Now we can separate those, taking out all the numbers at all the a's,
so we'll have n - 1 terms.
We have n^(n - 1) here times all the numbers is still equal to (n - 1)!
This is the same as (n - 1)!.
Now we can remove these terms, and we're left with exactly what we wanted--
that a^(n - 1)! is congruent to 1 mod n.
This is pretty close to what we want, but we needed for Euler's theorem
and what we'll need for the RSA correctness proof is this property with φ(n).
That's different from what we have here.
