Tikalon Header Blog Logo

Holey Numbers

August 1, 2012

Many ideas have come to scientists in dreams. The example always cited is Kekulé's revelation about the structure of benzene. which he claimed to have discovered in a day-dream of a snake seizing its own tail (an image called the Ouroboros). Benzene structure with Ouroboros

Snakes in the Plane.

Kekulé claimed that the structure of benzene appeared to him in a dream that included a snake eating its tail.

(Ouroboros image and the benzene structural diagram,via Wikimedia Commons)

Several nights ago, an integer sequence came to me in a dream; or, perhaps, at the point when I checked my digital clock and saw it read 2:08. At that point, I realized that there were two types of numbers beyond the even-odd classification. Some digits, such as 0, 6, 8, and 9, contain loops, and the others don't. These unusual numbers make an integer sequence.

There are actually two ways to interpret this, depending on whether you write "4" with a loop, or without. My digital clock depicts the numeral, 4, in a seven segment format without a loop (see figure). I write the number four without a loop. My father, who was likely influenced by the technical drawing course he took in high school, wrote his fours with a loop, just like the font used to display this article (specified in my CSS instructions as "font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif"), and on the keycap for the number four on the keyboard that I'm using to type this.

Characters on a seven-segment display

Numbers represented on a seven-segment display. (Illustration by the author)

In any case, when I awoke, I ran to that same keyboard, and I brought up The On-Line Encyclopedia of Integer Sequences™ (OEIS™) to find whether my integer sequence was unique.[1] It was already classified, by none other than Neil J. A. Sloane, himself, and named the "holey numbers." Note that the unholy number, 666, is a holey number.

There are a few integer sequences with a holey quality.
Integer sequence A001746, integers for which at least one character is a loop character, four excluded; e.g., 0, 6, 8, 9, 10, 16, 18, 19, 20, 26, 28, 29, 30, 36, 38, 39, 40, 46, 48, 49, 50...

Integer sequence A001745, as above, but with four included; e.g., 0, 4, 6, 8, 9, 10, 14, 16, 18, 19, 20, 24, 26, 28, 29, 30, 34, 36, 38, 39, 40, 44, 46, 48, 49, 50...

Integer sequence A001743, integers for which every character is a loop character, four excluded; e.g., 0, 6, 8, 9, 60, 66, 68, 69, 80, 86, 88, 89, 90, 96, 98, 99, 600, 606, 608, 609, 660, 666, 668, 669, 680, 686, 688...

Integer sequence A001744, integers for which every character is a loop character, four included; e.g., 0, 4, 6, 8, 9, 40, 44, 46, 48, 49, 60, 64, 66, 68, 69, 80, 84, 86, 88, 89, 90, 94, 96, 98, 99, 400...
I was inspired enough by my brush with glory to compose two computer programs for finding such numbers. The first of which (holey_numbers.c) calculates the integer sequence A001745; and the second of which (holey_numbers_02.c) calculates the integer sequence A001744. These are the sequences that include four, but a slight modification of the programs will give the other sequences. The programs are written for integers up to 32,767, but you can modify for long integers.

The following graph shows the distribution of the first 625 integers of sequence A001744 in the first 10,000 numbers. As can be expected, "wasteland areas" in which there are no numbers for an extended period, are a feature of the distribution. It's obvious from introspection that the numbers from 1,000 through 3,999 all have a non-loop initial character, and they will create one such wasteland.

Distribution of holey numbers

Graphic by the author, via Gnumeric)

So, what are holey numbers good for? In my case, they forced me to relearn parts of the C programming language I had forgotten. As far as their other utility, it's a lot like the quotation attributed to both Michael Faraday and Benjamin Franklin when asked about their discoveries - "What use is a baby."[2]


  1. The On-Line Encyclopedia of Integer Sequences™ (OEIS™). At this writing, the OEIS contains 212,514 sequences.
  2. One reference to Faraday can be found at Henry A. Torrey, "Glimpses into the Structure of Molecules," Harper's Monthly Magazine, vol. 120, December, 1909 - May, 1910, pp.261-266. A reference to Franklin can be found at G.A. Bobrick, "Liquid Air," Journal of Electricity, Power and Gas, vol. 13, January-December, 1903, pp.368-372.

Permanent Link to this article

Linked Keywords: Scientist; dream; Friedrich August Kekulé von Stradonitz; Kekulé; benzene; snake; tail; Ouroboros; Wikimedia; Ouroboros image; benzene structural diagram; integer sequence; digital clock; parity; even-odd classification; numerical digit; digit; seven-segment display; technical drawing; high school; font; Cascading Style Sheets; CSS; keycap; keyboard; The On-Line Encyclopedia of Integer Sequences; OEIS; Neil J. A. Sloane; Number of the Beast; unholy number; Integer sequence A001746; Integer sequence A001745; Integer sequence A001743; Integer sequence A001744; 15 minutes of fame; brush with glory; computer program; holey numbers.c; holey numbers 02.c; long integers; cumulative distribution; distribution; introspection; A001744; Gnumeric; C programming language; Michael Faraday; Benjamin Franklin.