Can You Dij It? #1

The most powerful drug in the world is water. The second most powerful is language. But everyone’s on them, so nobody realizes how powerful they are. Well, you could stop drinking water. Then you’d soon realize its hold on the body and the brain.

But you can’t stop using language. Try it. No, the best way to realize the power of language is to learn a new one. Each is a feast with different flavours. New alphabets are good too. The Devanagari alphabet is one of the strongest, but if you want it in refined form, try the phonetic alphabet. It will transform the way you see the world. That’s because it will make you conscious of what you’re already subconsciously aware of.

But “language” is a bigger category that it used to be. Nowadays we have computer languages too. Learning one is another way of transforming the way you see the world. And like natural languages – French, Georgian, Tagalog – they come in different flavours. Pascal is not like Basic is not like C is not like Prolog. But all of them seem to put you in touch with some deeper aspect of reality. Computer languages are like mathemagick: a way to give commands to something immaterial and alter the world by the application of will.

That feeling is at its strongest when you program with machine code, the raw instructions used by the electronics of a computer. At its most fundamental, machine code is simply a series of binary numbers controlling how a computer processes other binary numbers. You can memorize and use those code-numbers, but it’s easier to use something like assembly language, which makes machine-code friendlier for human beings. But it still looks very odd to the uninitiated:

setupnum:
xor ax,ax
xor bp,bp
mov cx,20
clearloop:
mov [di+bp],ax
add bp,2
loop clearloop
ret

That’s almost at the binary bedrock. And machine code is fast. If a fast higher-level language like C feels like flying a Messerschmitt 262, which was a jet-plane, machine-code feels like flying a Messerschmitt 163, which was a rocket-plane. A very fast and very dangerous rocket-plane.

I’m not good at programming languages, least of all machine code, but they are fun to use, quite apart from the way they make you feel as though you’re in touch with a deeper aspect of reality. They do that because the world is mathematics at its most fundamental level, I think, and computer languages are a form of mathematics.

Their mathematical nature is disguised in a lot of what they’re used for, but I like to use them for recreational mathematics. Machine-code is useful when you need a lot of power and speed. For example, look at these digits:

1, 2, 3, 4, 5, 6, 7, 8, 9, 1*, 0*, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 8, 2, 9, 3, 0, 3, 1, 3, 2, 3, 3, 3, 4, 3, 5, 3, 6*, 3*, 7, 3, 8, 3, 9, 4, 0, 4, 1, 4, 2, 4…

They’re what the Online Encyclopedia of Integer Sequences (OEIS) calls “the almost natural numbers” (sequence A007376) and you generate them by writing the standard integers – 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13… – and then separating each digit with a comma: 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 0, 1, 1, 1, 2, 1, 3… The commas give them some interesting twists. In a list of the standard integers, the 1st entry is 1, the 10th entry is 10, the 213rd entry is 213, the 987,009,381th entry is 987,009,381, and so on.

But that doesn’t work with the almost natural numbers. The 10th entry is 1, not 10, and the 11th entry is 0, not 11. But the 10th entry does begin the sequence (1, 0). I wondered whether that happened again. It does. The 63rd entry in the almost natural numbers begins the sequence (6, 3) – see the asterisks in the sequence above.

This happens again at the 3105th entry, which begins the sequence (3, 1, 0, 5). After that the gaps get bigger, which is where machine code comes in. An ordinary computer-language takes a long time to reach the 89,012,345,679th entry in the almost natural numbers. Machine code is much quicker, which is why I know that the 89,012,345,679th entry begins the sequence (8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 9):

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 63, 3105, 43108, 77781, 367573, 13859021, 77911127, 911360799, 35924813703, 74075186297, 89012345679…

And an ordinary computer-language might give you the impression that base 9 doesn’t have numbers like these (apart from the trivial 1, 2, 3, 4, 5, 6, 7, 8, 10…). But it does. 63 in base 10 is a low-hanging fruit: you could find it working by hand. In base 9, the fruit are much higher-hanging. But machine code plucks them with almost ridiculous ease:

1, 2, 3, 4, 5, 6, 7, 8, 10, 570086565, 655267526, 2615038272, 4581347024, 5307541865, 7273850617, 7801234568…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s