Interesting Numbers

Long ago, I worked with a programmer who had a habit of referring to certain values as “interesting.” What was an interesting number to him? 43,690. Yeah, it seems dull, but in hex it’s 0xAAAA and in binary it’s 1010101010101010. Interesting.

Mathematicians have a slate of numbers they find interesting. Most of the fascinating ones are assigned to letters such as π, e, and φ. Mercifully, this Exercise isn’t about those numbers.

For a typical human, an interesting number might be 777 — especially if you’re in Las Vegas. The number itself isn’t particularly useful nor does it harbor any mathematical curiosities. It’s just three repetitive digits.

Your task for this month’s Exercise is to write code that plucks out all the triple-digit “interesting” values from 100 through 1000. Specifically, these values: 111, 222, 333, 444, 555, 666, 777, 888, 999.

I can imagine several ways to accomplish this task, one of which doesn’t use math at all!

Click here to compare my solutions with your own.

2 thoughts on “Interesting Numbers

  1. There is a quiz show on British TV called QI (short for quite interesting) with a panel of comedians and other celebrities answering obscure questions about science, history etc.

    A while ago they had a question about interesting numbers and the idea that they couldn’t exist. This is because the lowest non-interesting number is actually interesting just through being the lowest non-interesting number. The next non-interesting number then becomes the lowest, therefore becoming interesting and so on ad-infinitum.

  2. I suppose mathematicians need something to keep themselves busy. But it’s brilliant that it took a group of comedians and celebrities to figure that out!

Leave a Reply