The Printing Of Pi

It really isn’t necessary, but there is some geek cred to learning pi to some bizarre number of digits. One way to do that is via a piem — a mnemonic device that is easy to remember and gives you the digits. Don’t know any? [Roni Bandini] has you covered with the PiemPi machine. It prints a random piem on a thermal printer and calculates each digit on the fly. You can watch the machine in action in the video below.

Unfortunately, the Raspberry Pi Zero inside doesn’t have enough language skills to ensure the thing makes sense, so you get word salad that may or may not have any real meaning. For example, [Roni] quotes astronomer [Sir James Jeans’] phrase: “How I want a drink, alcoholic, of course, after the heavy lectures involving quantum mechanics.” Before the advent of calculators, we always used: “May I have a large container of coffee today?” In each case, you count the number of letters in each word to get the digits. However, some of the piems you can see from the machine start off with phrases like: “# leon a yahoo execution im actual total pit eagle detector christmas…”

Since the machine can generate many digits, there is a problem that starts at digit 33. There are several zeros in the number. In this case, the printer prints a blank line. We might not have used symbols in the output, but since the phrases don’t really make sense anyway, it probably doesn’t matter much. Of course, there’s also little point in computing the digits for each print. You could compute them once, store them, and never have to do it again. Pi doesn’t change value. However, as a fun project, it doesn’t matter, and it does illustrate how a computer can find pi. In this case, the system uses the Chudnovsky algorithm.

If you don’t want to wait for the little Raspberry Pi, the 10, trillionth digit of pi is, by all accounts, 5. The problem with printing this is you need a lot of paper if you want to get up into the trillions. But you could use a Mobius printer (although full disclosure: that device grabs digits from the pi-as-a-service server; try curl "").

15 thoughts on “The Printing Of Pi

  1. “It really isn’t necessary”

    Actually it very much is necessary. Competition and the promise of bragging rights are important motivational tools for inventors and engineers. Every scientific and engineering discipline regularly engages in competitions, and it is through these competitions that many important breakthroughs are made.

    In this particular case, calculating the digits of pi is a simple way to track the increases of computing power over each new generation of hardware. Like the developers that love to test new hardware against the question, “Can it run Doom?”, it may seem like a pointless exercise because it’s not a frequent or necessary use case for the real world. But if you view it as just another benchmark, then it makes perfect sense.

  2. Need to ask a stupid question: how do we know that a circle is actually a pi function. A hundred places exceeds our ability to create such a circle accurately, much less measure the result

    1. Because pi isn’t measured using a ruler, at least not in the past several thousand years. It’s derived using (multiple) rigorous mathematical methods, which individually need not involve a circle directly, but all of which use a common definition of pi. Since that definition is π = C / d, it’s impossible for the circumference of a circle to not be a “pi function” unless every single method for calculating pi is incorrect. Even assuming they were (they’re not), that wouldn’t change the fact that a circle is π * d in circumference, it still would be; we’d just have miscalculated it and it would need to be corrected. A definition needs no proof, it just is.

  3. Does this actually allow anyone to remember any further than you could just remember directly?

    I remember 30 digits for some reason, and I think I’d be more likely to misremember grammatically similar words.
    Also, there’s the slowness of decoding it. if you’re not writing it down, you’re not going to be able to pull it out of your head. you’ll stop to count how many letters in “alcoholic” and then have to re-read the whole thing to remember where you were (like trying to read the alphabet backwards if you haven’t got it memorized)

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.