For any integer n, Z_n^* (Z with n-subscript and *-superscript) is defined as Z_n^* = { i in Z_n : such that i has a multiplicative inverse in Z_n } and it so happens that = { i in Z_n : such that gcd(i,n)=1}. This fact follows from the extended Euclidean algorithm. Now, when n is prime then Z_n^*={1,2,...,n-1}=Z_n-{0}, i.e., all the elements of Z_n minus zero. That is why, when n is prime, (Z_n,+,*) is a field.