<p>Ah, I see now. So for non-primes p, the ring {0,1,…,p-1} is not a field? For example, in mod 10, 6 divided by 4 does not give a unique solution…</p>
<p>Let’s see: 4<em>1 = 4, 4</em>2 = 8, 4<em>3 = 2, 4</em>4 = 6, 4<em>5 = 0, 4</em>6 = 4, 4*7 = 8,…</p>
<p>Notice the cyclical nature of the multiplications. So 6/4 has the two solutions 4 and 9.</p>
<p>When p is prime, all the nice algebra we’re used to can be done such as for the real numbers.</p>
<p>The simplest example of a ring that is not a field is the set of integers {…,-3,-2,-1,0,1,2,3,…}. Note that the only property that the integers are missing is that most numbers do not have multiplicative inverses (ie, reciprocals). Only 1 and -1 have reciprocals. Therefore you can’t solve equations such as 2n=5.</p>
<p>When p is not prime, you can think of the corresponding modular arithmetic rings as behaving a lot like the integers. But there are some differences. Some numbers do have inverses. For example, working mod 4, 3 is it’s own inverse. So 1/3 has the unique solution 3. But 2 has no inverse, so 1/2 has no solution.</p>
<p>I think that in general a number has an inverse if it is relatively prime with the mod.</p>
<p>Oh okay, I think I understand now…thanks DrSteve!</p>