Let’s go back to our Quantum Technology Series! Last time, we explored the One-Time Pad (read here), one of the simplest and strongest encryption schemes ever devised. Our long-term goal is to understand how today’s internet security protocols work — but before we can get there, we need to grasp one small but powerful mathematical idea: modular arithmetic.
Usually, we think of numbers stretched out in a straight line, with negatives on the left, positives on the right, and zero in the middle. But not everything in life runs in a straight line. Some things move in cycles. Time, for instance, loops every 12 hours on a clock. After 12 comes 1 again, and after 24 hours the Earth completes one full rotation, returning to the same point where it began. This kind of repeating pattern is called periodic, and the time it takes to return to the beginning is called its period.
Music behaves in a similar way. There are only 12 notes in the standard Western musical scale, each with a frequency related to the others. When you double the frequency, say from 440 Hz to 880 Hz, the sound feels the same—an octave higher, but still the same note. That’s because of how our ears and brain work: we don’t hear those two sounds as completely different, but as the same note repeating on a higher level. In a way, our sense of pitch naturally repeats—once we reach the top, it loops back to the start.

To describe such repeating systems, mathematicians came up with a clever idea called modular arithmetic. Instead of laying numbers out on a line, we imagine them arranged in a circle, like a clock. The size of that circle is called the modulus, often shortened to mod.
Let’s build this kind of math ourselves.