Balanced Heptadecimal: A Manifesto

If you’ve spent too much time in the company of nerds like me, you’ve maybe heard of the concept of counting in alternate bases. There are all kinds of weirdos out there advocating for different bases than the standard, comfortable decimal (base 10) that most of the world has settled on.

I’m not gonna get too in-depth on what a base is; if you’re here, you probably already know. (If you don’t and you want to look up more information, the search term you’re looking for is positional numbering system.) Instead I’m here to pose a simple question: Why are we focusing only on bases that make our lives easier?

Hi, my name is November and I’m here to talk to you about Balanced Heptadecimal.

A Worse Way To Count

We choose to use balanced heptadecimal, not because it is easy, but because it is hard.

—The Dead Kennedys

Heptadecimal, aka suboptimal, aka septadecimal maybe except that sounds too much like “septic”, which is what this base is. We’re talking about base 17.

The name “suboptimal” was coined by conlang Youtuber jan Misali as part of their attempt to give every base a name that breaks away from the decimal-centric language we’re all steeped in. It made me laugh, but for the purposes of this page, we’ll be going with “heptadecimal”.

Base 17 isn’t a very good base. 17 is a prime number, so nice clean fractions like 1/2, 1/3, and so forth are represented with infinite repeating digits. Basically the only fractions you can represent nicely are ones with 17 or a multiple thereof in the denominator. In addition, you have to add more digits! Generally we use letters of the alphabet for additional digits (hence why hex code has a bunch of A’s through F’s scattered throughout), but when doing arithmetic with such numbers, it’s a pain to read.

We can “fix” those problems by implementing heptadecimal differently – instead of using digits for 0 through 16, we’ll use digits for -8 through 8. On this page, I’ll be using regular digits with lines over them to represent these digits; 1¯\overline{1} for “1-1”, for example.

Wait you can’t do th

Sure I can. Balanced ternary is base 3 but with the digits 1¯\overline{1}, 00, and 11 instead of 00, 11, and 22. Signed-digit representation is an established math thing, it’s no big deal.

If you meant “you can’t use overlines to represent negative digits because those are traditionally used for repeating digits after the radix point”, well, yeah, that’s true. For that reason I’ll instead use ellipses (\dots) on this page for repdigits like that.

Unfortunately, this page isn’t accessible to blind readers. Actually, since I haven’t figured out how to pronounce negative digits, this page probably couldn’t even be read out loud at all. (To-do: Create a tonal conlang that uses this numbering system.)

So how does it work?

I lied, I’ll explain a little bit about what a number base really means. When you write a number in regular ordinary base 10, like for example:

17,01717,017

…each digit means something different based on where in the number it is. The 1 at the beginning of the number isn’t the same as the 1 that’s one position from the end. Remember math class where they taught you about the “ones place”, “tens place”, “hundreds place”, and so on? In base 10, the number 17,017 really means:

1×10,000+7×1,000+0×100+1×10+7×11\times10,000+7\times1,000+0\times100+1\times10+7\times1

It’s the same in other bases. Base 12 has a “ones place”, “twelves place”, “144s place”, etc.; base 2 has a “ones place”, “twos place”, “fours place”, and so forth; and base 17 has a ones place, seventeens place, 289s place, 4913s place, and you get the picture.

So the number 17,01717,017, taken as base 17, means:

1×83,521+7×4,913+0×289+1×17+7×11\times83,521+7\times4,913+0\times289+1\times17+7\times1

And you get the decimal number 117,936117,936.

Note that any balhep number with only positive digits is written exactly the same way in regular heptadecimal.

Balhep?

Balanced heptadecimal.

So how does it work, part II

Now for the negative digits! They may sound weird, but they work exactly the same way as positive digits. Take the balhep number 17¯1\overline{7}, for example:

1×177×11\times17-7\times1

And we find that the weird-looking number 17¯1\overline{7} is just our good old friend, decimal 10! Here’s all the balhep integers from 1¯0\overline{1}0 to 1010. If any of these representations confuse you, take a second to think about what each of the place values really stands for.

Non-positive integers Non-negative integers
1¯0\overline{1}0 00
1¯1\overline{1}1 11
1¯2\overline{1}2 22
1¯3\overline{1}3 33
1¯4\overline{1}4 44
1¯5\overline{1}5 55
1¯6\overline{1}6 66
1¯7\overline{1}7 77
1¯8\overline{1}8 88
8¯\overline{8} 18¯1\overline{8}
7¯\overline{7} 17¯1\overline{7}
6¯\overline{6} 16¯1\overline{6}
5¯\overline{5} 15¯1\overline{5}
4¯\overline{4} 14¯1\overline{4}
3¯\overline{3} 13¯1\overline{3}
2¯\overline{2} 12¯1\overline{2}
1¯\overline{1} 11¯1\overline{1}
00 1010

As you can see, we don’t even need a negative sign for negative numbers! If the leftmost (non-zero) digit is negative, then the whole number is negative!

Assorted cool facts

Conclusion

Anyway, this was just a fun little project I spent a couple days on after re-watching jan Misali’s “A Better Way To Count” video. In doing so, I:

Obviously I don’t really want to replace the decimal system with, uh, this, (unless…? 😳) but it’s funny to think about.

Further reading

Heptadecimal representations of fractions
Balanced heptadecimal arithmetic
Alternatives I considered for digit representation
Other number systems