Roman numbers ↔ Latin alphabet counter

We can number lists using different counter styles, for example using Hindu–Arabic numerals and the decimal system 1, 2, 3, …, 9, 10, 11, … or using the Latin alphabet A, B, C, …, Z, AA, AB, … or using the Roman number system I, II, III, IV, V, VI, ….

When we ignore the values of these symbols for a moment and only look at the characters used, we see that the Roman numerals are a subset of the Latin alphabet. Furthermore the alphabet counter uses every possible combination of letters. Hence for every Roman number there is a number in the Latin alphabet counter that looks the same.

For example, the Roman numeral for one, I, also appears in the Latin alphabet counter where it represents the number nine, as it is the ninth letter in the alphabet. V is a Roman five and at the same time the twenty-second letter in the alphabet. DC is a Roman six hundred and at the same time one hundred and seven in the Latin alphabet counter.

I’ve compiled a table that lists all Roman numbers from one (I) to 3999 (MMMCMXCIX) and the corresponding values which the same representations have when interpreted as Latin alphabetic numbers:

See the conversion table!

How do you do this?

There is no universally accepted standard of writing Roman numbers. For example, analog clock faces often display four as IIII instead of IV like I did above. So let’s settle on a convention first. I chose the one used for counter styles in cascading style sheets (CSS). It corresponds perfectly to what I learned at school about Roman numbers, although the explanation differs a little.

Step 1

The CSS specification defines thirteen Roman symbols, each consisting of one or two letters, and their corresponding values displayed as decimal numbers here. When you want to write a natural number with Roman numerals, you start at the left side of the table, at the first symbol M.

symbolMCMDCDCXCLXLXIXVIVI
value1000900500400100905040109541
Table 2: Roman number symbols and their values

If your number is at least as big as the value of the current symbol, you write down the current symbol and reduce your number by the symbol’s value, otherwise you move right to the next symbol. Repeat this until your number is zero.

You’ll write done your initial number in terms of Roman numerals in the process. Easy, isn’t it? That’s the first step. The second step is to interpret that string of symbols as a Latin alphabetic representation and compute its value.

Step 2

The alphabetic number system is a positional system like our decimal system, but without a number zero. The letters A to Z are its digits and correspond to the values 1 to 26. You will only need a small subset of these when reinterpreting Roman numbers:

digitCDILMVX
value34912132224
Table 3: selection of digits from the alphabetic number system

You compute the value of an alphabetic number by multiplying each digit’s value with the positional value of its place in the number and adding these products up. The positional value of the rightmost place is 260 = 1, the value of the second place from right is 261 = 26, the value of the third place from right is 262 = 676. In general, the value of the n-th place from right is 26n−1.

Example: 54

Confused? An example will help. Let’s find the Roman number representation of fifty-four.

Look at table 2 and find the leftmost symbol whose value is equal to or lower than our number fifty-four. That would be L. Write down L and reduce our number by the value of L, fifty. That leaves us four. Now find the leftmost symbol whose value is equal to or lower than our number four. That is IV. Write down IV and reduce our number by the value of IV, which is four. That leaves us zero, so we are done with the first step. You have written down LIV and that’s indeed how Romans would write fifty-four:

LIV

Now reimagine LIV as a Latin alphabetic number representation. To compute its value, start at its right side with the digit V. The digit value of V is 22 according to table 3. Multiply that with the positional value of the rightmost place, 260.

22 ⋅ 260 = 22

Now move one place left to I, raising the positional value to 261. The digit value of I is 9. Multiply those values:

9 ⋅ 261 = 234

The positional value increases to 262 when you move another place to the left, where we find L, which has a digit value of 12. The corresponding product is

12 ⋅ 262 = 8112

Finally add 22 + 234 + 8112 and that’s the value of LIV when interpreted as Latin alphabetic number:

8368