Modular arithmetic is a relatively simple idea to define. The natural motivation is to consider a clock. The display of a standard analogue clock makes no distinction between 4am, 4pm, and 4pm next Thursday. This is a direct visualisation of the integers modulo 12. Instead of counting in the usual way, where each successive integer is different to all those considered previously, here, every time we get to a multiple of 12, we reset our count back to zero. As a result, this procedure is often referred to as `clock arithmetic’.

A common problem for good students, for example those starting the UKMT’s Senior Mentoring Scheme, is that the idea of modular arithmetic seems very simple, but it’s hard to work out how it might be useful in application to problems. My claim is that the language of modular arithmetic is often the best way to discuss divisibility properties in problems about whole numbers. In particular, the behaviour of powers (ie and so forth) is nice in this context, and the notation of modular arithmetic is the only sensible way to approach it. Anyway, let’s begin with a quick review of the definitions.

**Definitions**

We are interested in divisibility by some fixed integer , and the remainders given after we divide by *n*. Given an integer *M*, we can write this as:

and this decomposition is *unique*. We then say that M is *congruent* to *a* modulo *n*. Note that working modulo *n*, means that we are interested in remainders after division by *n* (rather than *a* or *k* or *M* or anything else). This has the feeling of a function or algorithm applied to *M*. We get told what *M* is, then work out the remainder after division by *n*, and say that this is `*M* mod *n*‘.

This is fine, but it very much worth bearing in mind a slightly different interpretation. Working modulo *n* is a way of saying that we aren’t interested in the exact value of an integer, only where it lies on the *n*-clock. In particular, this means we are viewing lots of integers as the same. The `sameness’ is actually more important in lots of arguments than the position on the *n*-clock.

More formally, we say that or *a* is *congruent* to *b* modulo *n*, if they have the *same* remainder after division by *n*. Another way of writing this is that

Sets of integers which are equivalent are called *congruence classes*. For example is a congruence class modulo 3. Note that under the first definition, we consider all elements here to be congruent to 2, but in a particular question it may be more useful to consider elements congruent to -1, or some combination.

These definitions are equivalent, but it can be more useful to apply this second definition for proving things, rather than writing out or whatever all the time.

**Addition and Multiplication**

Everything has been set up in terms of addition, so it is easy to see that addition works well on congruence classes. That is:

We could argue via a clock argument, but the second definition works very well here:

We want to show that a similar result happens for multiplication. But this holds as well:

Let’s just recap what this means. If we want to know what is modulo 9, it suffices to say that and , and so . In a more abstract setting, hopefully the following makes sense:

This is exactly the statement of the result in the case *n=2*, where the congruence classes are the odd integers and the even integers.

**Powers**

What happens if we try to extend to powers? Is it the case that