The topic of numeral systems is something I wanted to cover in the previous post on number theory. That post got too long before I could even get to it, however. So, here we are, talking about it now. This topic is about the concrete ways of representing the otherwise abstract notions of numbers. Both in written form, as well as when stored as information in other types of media, like computer memory.

Today’s post will give you intuition about the way we represent numbers and it will probably make you appreciate numbers themselves even more. It’s also going to serve as a final warm-up for my upcoming post on modular arithmetic, as the two topics are tightly related.

I’m going to assume you’re familiar with integers and the basic arithmetic operations with them (as well as their properties). If you need a refresher, check out my series on numbers and arithmetic.

#### Visual intuition about numeral systems

As a subject, numeral systems are very easy and intuitive to grasp, as long as they are presented properly. And I think visual intuition can make all the difference here. That’s why I made a lot of animations for this post that all use the same visual aid: clocks! In particular, I’m going to show you how counting works in a wide variety of integer bases (both positive and negative).

In fact, let me get you in the mood before we even start exploring the topic in more depth. Here’s a short video that shows counting from zero to sixty in bases ten, two, five, and sixteen (you might want to watch it in full screen):

The purpose of this video might not be immediately obvious, but you’ll see the explanations in the text below. And you’ll also see many other animations inside the text that show counting in all bases from negative to positive 16.

Important note about the animations to follow: Apart from the video you just saw, the remaining animations are in the GIF format, initially loaded as static images. I do this “trick” in every post with animations in this format, in order to make the initial loading of the page less heavy for you. This time, the GIFs are a bit larger in size, so it might take a couple of seconds for them to load when you click on them for the first time (depending on your internet connection). But once you load an animation, you’ll be able to start/restart it with no delays afterwards.

Just so you know what I’m talking about, here’s an example of one such animation:

Anyway, without further ado, let’s delve into today’s topic!

Table of Contents

## What is a numeral system?

Let’s think about the question: how do we represent natural numbers in written form?

Historically, the most primitive way was to use **tallying**. One stroke for the number “one”, two for “two”, etc. With this system, we have a single symbol and we repeat it as many times as the number we’re trying to represent.

But we have infinitely many natural numbers, right? And representing large numbers with this system is impractical, to say the least. It would take you a whole book to write a number as small as a million, which we can otherwise write very compactly as 1000000 (it took only seven symbols, not a million of them).

Now imagine the other extreme. What if we had a *unique *symbol for every number? Then the representation would be as compact as possible — only one symbol per number. Are there any problems with this system? Well, for starters, there are infinitely many numbers, so we would have to keep inventing a new symbol for every number. But even if somehow most of mathematics (and its applications) was magically limited to numbers less than or equal to, say, a million, that would still require learning a million different symbols and their meanings! That sounds even less practical.

### The need for a smarter numeral system

Looks like these two extremes just won’t do it. And I’m not even listing all the issues. Imagine trying to do any arithmetic with either of these representations (like addition, multiplication, or taking square roots).

Therefore, we need some system for representing numbers that uses a finite number of symbols (few enough to be easy to learn) and capable of representing large numbers compactly. Furthermore, the system should be “arithmetic friendly” in the sense that it should be easy enough perform various arithmetic operations with two or more numbers.

There have been many different numeral systems developed by different peoples throughout history. Some of them made use of already existing alphabets, whereas others invented special symbols for numbers. And each system had its own rules for how to combine the symbols to represent arbitrary numbers.

But here I want to cut to the chase and talk about the subset of numeral systems considered most convenient, which dominate mathematics nowadays. Namely, the ones using positional notation with Arabic numerals.

## Positional numeral systems

To understand this type, let’s look at the most familiar example of all — the (**Hindu-)Arabic numeral system**.

Now, even though this image shows the representation of the numbers one through ten (for comparison with the tallying image above), the unique symbols here are reserved for the numbers zero through nine. So, this system uses exactly ten unique symbols, called **digits**, to represent any number: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.

A single number’s representation uses one or more of these digits, written one after another from right to left. The position of each digit represents its **place value**, which you can intuitively think of as its “weight”.

We use the available digits to represent the first ten natural numbers (zero through nine) in the order I gave in the previous paragraph. You basically start from the number “zero” and assign the symbol 0 to it. Then, you go to the next number and assign the next symbol to it — 1 to “one”, 2 to “two”, 3 to “three”, and so on. But when we reach the number “nine”, we’ve used up all of the available symbols, right? So, how do we write the *next* number?

The idea is very simple. When we reach 9 and want to increment by 1, we set the first digit to 0 and introduce a new digit to its left equal to 1. So, the next number becomes 10. Then we go back to incrementing the right digit to 11, 12, 13, …, 19. Since we reached 9 again, we set it back to zero and increment the left digit by one (to get 20). As we continue incrementing, at some point we reach the representation 99. Then, we set both digits to 0 and introduce a third digit to the left and set it to 1. This gives us the representation 100.

### How positional notation works

Imagine you have a large pile of apples that you want to count using the following method.

One by one, you start moving the apples to a new pile by putting each in a small green box. When you get exactly ten green boxes in the new pile, instead of adding another another one, you put all ten of them in a red box. Then, you start a new pile with the eleventh, twelfth, etc. apples, until you get another set of ten green boxes. At which point you put those in another red box and now you have everything nicely organized into two red boxes.

As you continue moving apples, the number of red boxes itself starts growing. And when you reach exactly ten red boxes, you put those in a larger blue box. With more and more apples, at some point the number of blue boxes also becomes ten and then you put *those* in an even larger purple box. And so on.

Now, let’s say that after you’ve moved the last apple from the original unorganized pile, the situation looks like this:

We know that each green box has exactly one apple and each red box has exactly ten apples (because it contains ten green boxes). Therefore, a blue box, having ten red boxes, will contain apples, or simply a hundred apples. Similarly, a purple box will have , which is a thousand apples. With the apples neatly organized like that, it becomes very easy to spot their total count at a glance! We say there are “two thousands, four hundreds, one tens, and 3 ones“, which in plain English translates to “two thousand four hundred thirteen”:

Notice that organizing the apples into boxes with this system guarantees that at no point will you have more than 9 of any box type!

### The decimal system

The representation I just described is called the **decimal numeral system**, with the more technical name **base 10** **numeral system**. The word *decimal* itself comes from the Greek word *deca* (meaning “ten”). The system is called decimal precisely because of the convention for grouping every unit into tens to form the next (bigger) unit. In other words, each unit represents *ten* of the smaller units.

Obviously, we’re not limited to the four box types above. If the purple boxes themselves reach the number ten, we would put those in a box of another color, and so on. However, in order to not have to come up with different colors for each box, we simply use the box’s position as the indicator of how many apples it stands for.

You can think of each box as standing for some power of 10. The rightmost box stands for , followed by , , and so on. And each is multiplied by some coefficient in the range 0 through 9. For example, the number 2413 from above stands for:

In general, an n-digit number stands for:

Here any coefficient is the digit that multiplies (the respective power of 10).

In practice, we only write the digits up to the largest whose coefficient is not zero. However, you can think of any number as an infinite sum of all natural number powers of 10 (of which only finitely many have non-zero coefficients). Meaning, the number 3 is equivalent to 03, 003, 0003, and so on.

#### Multiplying by ten

There’s something special about multiplying any number by 10. Essentially, you multiplying any number by 10 is equivalent to appending a 0 to the right end of the number. Have you thought about why it works like that?

Think about the colored boxes representation again. Notice how multiplying by 10 simply means multiplying each box type by 10. But we know that when you have 10 of a particular box type, we just pack all the boxes into a single box of the larger type.

Therefore, every green box (representing the *ones* place) you had prior to the multiplication will become a red box (*tens* place). Red boxes themselves will become blue boxes (hundreds place), blue boxes will become purple boxes (thousands place), purple boxes will become yellow boxes (ten thousands place), and so on.

And you’re always going to be left with zero green boxes, so the *ones* place will necessarily be equal to zero. Therefore, multiplying any number by 10 requires simply appending a 0 to its right. And that’s why all integer multiples of 10 have 0 in their *ones* position:

I’m going to come back to this point when we look at positional systems with different bases. But before that, I want to show you an intuitive representation of counting in base 10 that involves a set of special clocks. It will seem a bit trivial at first, but this representation is going to be very useful for gaining intuition about other positional systems.

### Positional numeral systems as a series of clocks

Most typical clocks have the numbers 1 through 12 written equally spaced around a circle. These numbers represent the twelve hours of one *half-day* and one of the clock’s hands (the “hours” hand) points at the current hour. The other hands typically point at the current minute and second but let’s ignore them here.

Well, it turns out that clocks are also a pretty convenient tool for giving intuition about numeral systems. To show you, I want to make two modifications to this clock. First, I want to use the convention for displaying the last hour as 0, instead of 12. So, twelve o’clock becomes zero o’clock and is now the *first* hour. Second, to adopt it to base 10, I want to reduce the number of hours from 12 to 10 by imagining that one hour is 72 minutes, instead of 60.

So, from now on we’re only going to deal with the final version on the right:

#### Place value and counting

Imagine a series of five of these clocks where each clock represents place value. That is, the rightmost clock represents the “ones” position, the next clock represents “tens”, and so on. Then, we can interpret the position of each clock’s hand as the coefficient for that particular place value.

Take a look at this image, where each clock’s place value is represented by the power of 10 above it (in blue) and the respective coefficient for that position is below it (in red):

The leftmost clock whose hand *doesn’t point at zero* stands for the so-called **most significant digit**. And the value of the rightmost clock represents the **least significant digit**. In the 2413 example from the previous section, 2 is the most significant and 3 is the least significant digit.

Why do we talk about the digits in terms of “significance”? Well, think about which errors matter most. If you make a mistake about the *ones place digit*, you can be off by at most *nine*, right? Whereas, if your mistake is in the thousands place, you’d be off by at least a thousand!

Now, remember the base 10 counting process I explained with those colored boxes? Take a look at this animation to see how the same process works with these clocks when we count to thirty-one:

Also watch the next animation to see example representations of larger numbers:

You see how every time a clock’s hand completes a full turn and makes the step from 9 to 0, the hand of the clock to its left simultaneously also makes one step? Just like in the example from the previous section where we moved the smaller boxes into 1 large box whenever we get 10 of them.

## Numeral systems in different bases

Once we know the principles behind the base 10 system, understanding numeral systems in other bases is very easy. In fact, I’m going to use the same clocks to show you how those systems work.

Have you thought about why base 10 has become the most common numeral system? In the counting method I described, we made the explicit choice to group objects into tens. But why not choose another number? Most historians’ opinion is that the choice for 10 is related to early people’s tendency to count using the 10 fingers of their hands. But the fact is, we could have chosen any other convention and work with it just fine!

For example, if we grouped objects into nines instead, this simply means that the digits’ positions now stand for powers of 9, instead of 10. So, the representation of an arbitrary number looks like:

Which also means that the coefficients now range from 0 to 8 because there can never be 9 or more of any place value.

And we can use nine-hour clocks to count and represent numbers. This is called the **base 9** numeral system:

For another example, consider the **base 5** system:

Again, the idea is exactly the same as with base 9 and 10. Except, we’re combining the units into groups of five:

For numeral systems of any base

*b*, you simply group together the units into larger units of

*b*, where

*b*can be any integer greater than 1. And the general representation of any number is:

Alright, now let’s get some actual intuition. In the rest of this section, I’m going to show a lot of animations with counting in different bases.

I’m first going to start with other positive integer bases less than 10. Then, I’m going to show you bases larger than 10 where we will need to invent new symbols to represent the extra digits.

Then, in the next section, I’m going to show you how counting works when dealing with *negative* integer bases. Finally, I’m going to break even more boundaries and consider *mixed* base numeral systems.

### Bases 2 through 9

Before I tell you anything else, let’s compare counting in different bases to the counting we did in base 10.

I made a few animations using the same “clock” method. Each of the eight animations below shows how incrementing the digits at different positions works in bases 9 through 2. You can click on any of them as many times as you want. Each click will restart the animation, so take your time with them to get a good feeling of what’s going on.

In each animation, the blue number above the clocks shows the current count in base 10. The red digits under each clock are the coefficients of the respective place value. And if you concatenate those digits, you get the representation of the blue number in the respective base.

Of all these systems, the most important one is the last one. In many fields, particularly those related to computer science, base 2 holds even higher significance than base 10. This is because computers and most other electronic devices use this base to internally represent any information.

By the way, notice how for each base *b*, the *bth* number’s *ones* digit is always zero? That is, in base 3 every 3rd number ends with 0. Similarly, in base 7 every 7th number ends with 0, and so on. This is exactly like how every 10th number ends with 0 in base 10. I think these animations give a pretty good intuition for why it works like that — just pay attention to how many steps it takes for the rightmost clock to hit 0!

From this we can conclude that every element of (the multiples of *b*) will have 0 as the least significant digit in its base b representation.

#### Notation for numerals in different bases

When you see a numeral like 182, you know it stands for “one hundred and eighty-two”. You know to interpret the rightmost digit as *ones*, the next as *tens*, and the leftmost as *hundreds*, since base 10 is the default convention. But if you’re writing the number in another base, you need to somehow convey that information to the readers.

The most common convention is to specify the base as a subscript of the numeral. For example, the sequence of digits 21412 in base b is written as:

The base

*b*itself needs to be expressed in a base-neutral way, right? So we can simply write things like:

But a better approach is to choose base ten as the privileged base for referring to numbers independently of their base. After all, we’re already used to it:

In general, whenever the base isn’t specified, you can safely assume the representation is in base 10. I’m also going to stick to this convention for the remainder of this post.

For a concrete example, take a look at the *end* of each animation above. They each show the representation of the number thirty-one in the respective base:

And if you watch the animations again, you’ll see that, at each step, the red digits show the representation of the current blue number in the respective base. For example, 17 in base 6 is .

When you’re reading numbers in bases other than 10, it’s best to simply read the digits separately, instead of using the actual English word. That is, read as “two-five (base six)”, instead of “twenty-five (base six)”. Otherwise you risk confusing yourself because the number formation rules in English are very much based on the decimal system in math (with a few exceptions).

In this framework, the **unary numeral system** is just a fancy name for tallying. And as I discussed in the beginning, it’s not a very practical system. You simply write the symbol 1 as many times as the number you’re trying to represent (and leave empty space for zero). For example:

Lastly, for obvious reasons, we can’t have a numeral system based on 0, as the multiples of all powers of 0 are 0.

### Bases larger than 10

There’s absolutely nothing stopping us from grouping units into chunks larger than 10. Except, in the traditional Arabic numeral system there’s only ten digits, which means that we need to invent new symbols to represent the new digits.

For that purpose, the most common convention is to use the first few letters from the Latin alphabet. For example, if we want to have twenty available digits, we could extend the set of digits 0123456789 into the set 0123456789ABCDEFGHIJ. However, here I only want to focus on bases up to 16, since base 16 holds a special importance in some fields.

Now take a look at the following six animations (again, click on any of them to start/restart):

Let’s look at the last values of the clocks for each base. You see that 31 has the following representations in bases 11 through 16:

The important takeaway is that, regardless of the base, the counting principle is exactly the same.

I told you that base 16 has important uses in some fields. To give one example, it is widely used to represent colors in the so-called red-green-blue (RGB) color model. For the curious among you, here’s a nice Numberphile video that discusses this base and its applications a bit more.

I told you I didn’t want to discuss bases higher than 16. In fact, for most things you’re going to do in life, you’ll likely never need to resort to bases other than 2, 10, and 16. But, to conclude this section, I do want to share another Numberphile video on another base which has historical importance.

## Non-standard numeral systems

The numeral system types I’m going to show you in this section aren’t very common. Chances are, you won’t really use them. However, understanding how they work will give you a much deeper intuition about positional systems in general.

Still, you can treat this section as *semi-optional* because I already told you the most important things you need to know on this subject.

### Negative bases

So, it turns out it’s also possible to use negative integers as a base for a positional numeral system. Well, negative bases work exactly like positive bases. The representation of any number still looks like:

Only this time

*b*is a negative integer! How would that even work?

Let’s consider base -10. It’s sometimes called the **negadecimal system** and represents numbers as powers of -10:

Notice something interesting, however. The even powers of -10 are actually positive numbers, which happen to occupy the odd positions in the representation. Which means that only digits at even positions stand for negative numbers and the odd position digits have the same place value as if the base were positive.

#### Negative place values

Let’s go back to the clock representation but this time use it on base -10. Here’s how it works:

You’ll notice that clocks with negative place value are in purple. Their sign becomes even clearer if we expand the powers:

Now let’s count to 31 in this base. Before I even explain anything, try to spot some patterns yourself:

So, what do we see here?

First, the “positive” clocks work the same as before. They just do their regular counting and when they make the transition from 9 to 0 (when they complete a full turn), they group whatever units they stand for into one unit of the clock to their left.

Second, negative clocks step in the opposite direction! But not only that, they also seem to be “nudging” their neighbor clock when they make the transition from 0 to 9. In other words, they behave exactly like positive place value clocks, but in reverse.

To gain some intuition, consider what happens at the moment we make the transition from 9 to 10. That is, when the rightmost (positive) clock completes a full turn. Until that point, counting works just as if we were counting in the usual decimal system. But then, instead of representing ten as 10, base -10 represents it as 190! What gives?

For starters, let’s convince ourselves that the representation really works:

So, (one-nine-zero, base negative ten) really does stand for . But why does it work like that? Why do we increment the digits of the negative place values in reverse? And why does a negative place value clock increment its neighbor when going from 0 to 9, instead of 9 to 0? Let’s tackle each question in turn.

#### How negative base counting works

Consider what happens when a positive clock completes a full turn. It zeroes out, packs its units into tens, and “increments” the next clock, right? But when the next clock has a negative place value, this means decreasing its coefficient!

Think of the negative place values as representing debt. Those of you who read my post on negative numbers will remember my “anti-apple” fictional object that represents a debt of one apple. So, if we go back to the counting apples example, the negative place values stand for a hypothetical *debt of apples*. When the leftmost (*ones*) clock makes a full turn, it forms a group of 10 apples which effectively takes away a debt of 10 apples. Which is achieved by reducing the coefficient of the -10 place value by 1.

The intuition for why a negative clock increments its neighbor when going from 0 to 9 is very much related. Going from 0 to 9 essentially introduces a debt of 9 units of that place value, right? But we can’t just create debt out of thin air. Instead, we first borrow 10 positive units from the next clock so that the effect of introducing 9 negative units is to introduce a single positive unit. And this new positive unit we just introduced stands for 10 positive units of the clock to the right of the negative clock (the one that nudged it to make a positive step in the first place).

#### Other negative bases

To gain even more intuition about negative bases, take a look at the following set of animations. They show counting to 31 in the bases -9 through -2. Again, click on each as many times as you like to start/restart.

Notice that 5 digits wasn’t enough to represent 31 in the last animation. It turns out we need at least 7 digits to write 31 in base -2.

If you’re curious, also take a look at how counting works in bases -11 through -16. Spoiler alert: everything works just the same.

### Mixed bases

Notice that in all bases we considered so far, every position has the same set of available digits. That is, every clock completes a full turn after the same number of steps as the clocks at other positions. But since we already made one generalization to include negative bases, why not generalize even further? In particular, why not consider bases where different positions can wrap around after different number of steps?

For example, you could have a system where only the first position has ten digits and the remaining positions are all binary (2s). Or the first three positions can have 4, 5, and 6 digits (respectively), while the remaining ones are all septenary (7s). Or literally any other combination that comes to your mind.

The good news is that these types of numeral systems work exactly the same as every other base I’ve shown you. In the four subsections below, I’m going to demonstrate this to you by considering a few extravagant bases. You’ll probably never use any of them (except the last one), but I think this section really completes the intuition for everything else we talked about today.

#### Positive mixed bases

In the first example I want to show you, the first place only has two digits, which means it “packs” into 2s. The second has 3 digits, the third has 4 digits, the fourth has 5 digits, and the remaining ones are all 6 digits each. So, this positional system looks like this:

The first place value is always “ones”, since it gets incremented by 1 at every step. That’s what it means to count, right? But what about the other places? Well, since the first one chunks the ones into groups of 2, the second place value is “twos”. Similarly, because the second position chunks those 2s into groups of 3, the third place value will be “three twos”, or simply “sixes”. And, more generally, every position’s place value will be equal to the product of the numbers of digits of all previous positions:

Or simply:

The place values of the sixth, seventh, etc. clocks that I’m not showing you here will then be , , and so on. Now take a look at how counting to 31 works in this system:

Now let’s look at a second example where the order of the clocks is reversed:

Here, place values look like:

Or simply:

Finally, let’s count to 31:

Pretty straightforward, isn’t it?

#### Negative mixed bases

Now let’s look at the same two sequences of clocks but with negative values. First, take a look at the system:

Here the place values looks like this:

Or, more compactly:

Again, everything works like you’d expect. We still have “negative” clocks at even positions and “positive” clocks at odd positions. Counting also works the same way:

And let’s also look at the reverse order:

And count to our favorite number 31:

#### Bases with alternating sign

Now let’s look at two bases where we have a mixture of positive and negative positions. The first one consists of an alternating sequence of positive and negative fours:

Here are the place values of each position:

And here’s how we count to 31:

And here’s the same alternating sequence but starting at -4:

Notice that in these examples there are two consecutive “negative” clocks. But that doesn’t change how counting works — they still go in reverse and nudge their neighbor when they go from 0 to the *largest digit* in the respective position.

#### Time and dates

Finally, let’s look at a mixed base system that you use all the time. Namely, the one with which we represent **time and dates**. I’m not going to show you any animations here since you already saw how counting works with all-positive mixed bases. I just want to draw your attention to the fact that something you’re familiar with is an example of a mixed base positional system.

In principle, there are many different units of time, as well as time formats that make use of some subsets of these units. Here I want to consider the following format:

The rightmost position counts seconds as “ones” and completes one turn after 60 steps. Then, the next position stands for minutes and it also has 60 values. The next positions are hours (24 values), days (30 values), months (12 values), and years (infinitely many values):

Infinity as a place value? That’s new. Also, notice that I made the simplifying assumption that every month is exactly 30 days (as you know, that’s not how it is). But stay with me for a now and I’ll come back to these questions in a moment.

Let’s represent this system with clocks. I don’t want to use 60 different symbols for seconds and minutes (nobody does it anyway), so here I’m going to represent the “digits” of each clock with decimal notation (as is common).

As always, each clock’s place value is in terms of the units of the rightmost clock. For example, the “days” clock’s place value is 86400 seconds, which means that, for every step this clock makes, exactly 86400 seconds pass.

You probably noticed that the “years” clock is missing. I deliberately left it out because you can’t really represent infinity as a clock. This brings me to the questions from the beginning.

##### Assumptions in representing time

Since counting never stops, we need to keep introducing digits to the left, as we reach larger numbers. In the standard positional systems (with positive integer bases) we know that every position is some power of the respective base. And even in the non-standard bases I showed you, there was some repeating pattern for all future positions.

Sometimes, however, it’s more convenient to only have a finite number of place values and have the leftmost place value grow infinitely. This holds true for most natural units, not just time. That’s because we don’t want to keep inventing words for larger and larger units. Besides, we’re already using the decimal system for counting those units anyway.

Still, why did I stop at years, aren’t there bigger units of time? Sure, we have decades, centuries, and more (and they certainly are part of some time formats). But it turns out that quite often it’s more convenient to have *years* as the most significant position. In fact, often we talk about very large time periods exclusively in years. It’s easier to relate a year to our personal experience, than a century (which is more than the average human lifespan). For example, we say that the Big Bang occurred almost 14 billion years ago, instead of almost 140 million centuries ago. Which of the two do you prefer?

The other simplifying assumption we made was that one month was always exactly 30 days. Which is far from true. In fact, the way we (humans) keep track of time is somewhat messy. Okay, maybe *very* messy, especially when you take things like time zones into account! So, in reality, “counting” with dates is much more complicated.

Take a look at this (optional) awesome 10-minute Computerphile video which will make you appreciate the difficulties I’m talking about:

Of course, we don’t need to be concerned with such hurdles in our everyday lives, since we use computers to automatically deal with them nowadays (as was explained in the video).

## Summary

So, in today’s post, everything was about counting in different integer bases. I showed you that, other than the trivial bases of 0, 1, and -1, every integer can be a valid base for a positional numeral system.

Positional numeral systems themselves are based on a very simple principle called place value. Every number’s numeral representation consists of a sequence of digits, each being the coefficient of the respective position’s value. The rightmost place value is always “ones” and each consecutive value is the next positive integer power of the respective base:

Where is the coefficient of the place value.

The most common one is the base 10 numeral system (b = 10). But, as I showed you today, any other positive integer value for b makes for a perfectly good numeral system. The most common alternatives (in different applications) are the base 2 and base 16 numeral systems.

I also showed you that even *negative integers* can be bases for a numeral system. And not only that, you don’t even have to use the same *b* for different positions! Mixed bases, where each position has a different set of available digits, also work, even when some or all positions represent negative units!

Everything about counting in different numeral systems I told you today can basically be summarized with the following principles:

- Start with all digits set to 0 (this is the representation of the number
*zero*in any base). - For every “next number” (one, two, three…), increment the rightmost digit by 1.
- Whenever the rightmost digit makes a “full turn” (goes from the highest value to 0), increment the next digit by 1.
- Apply the 3rd step for the digits in all other positions, whenever they complete a full turn.
- If a particular digit is the coefficient of a
*negative*place value, its digit is incremented in the reverse direction (decremented). Also, it completes a full turn (“nudges” its left neighbor) when it steps from 0 to the highest value (rather than from the highest value to 0).

The term for the rightmost place value’s coefficient is the least significant digit and that of the leftmost *non-zero* coefficient is the most significant digit. The place value of the former is always “ones” and every other place value is the product of the place values of the previous positions.

### What more about numeral systems?

There are two important things about numeral systems that I did not talk about today:

- How to convert between bases
- How to do arithmetic operations in different bases

To truly understand these topics in depth, we need the help of modular arithmetic. So, my next post from the “number theory” category is going to be the perfect place to show you how these things work. In the meantime, as a small exercise, think about it on your own. To give you a hint: it has a lot to do with Euclidean division.

Anyway, as always, if you have any questions or feedback, feel free to leave a comment in the comment section below. Until next time!

Julio Rives says

Very good work