The counting sentenceRomână

A game with letters and numbers

The sentence that counts its own letters

The sentence below says how many times each letter of the alphabet appears in it, from a to z. All 26 numbers are right, including for the letters in the words that spell the numbers.

The typecase holds exactly 194 metal letters: as many as the sentence needs, and not one more.

This short sentence contains three a’s, one b, three c’s, two d’s, thirty-three e’s, four f’s, two g’s, ten h’s, ten i’s, one j, one k, one l, one m, twenty-two n’s, sixteen o’s, one p, one q, nine r’s, twenty-five s’s, twenty-six t’s, two u’s, three v’s, eight w’s, three x’s, five y’s and one z.

Tap any letter in the sentence to count it.

On a piece of metal type the letter is cast in mirror image, so it prints the right way round. That is why the letters in the case look reversed.

Count it yourself: is it really true?#

Pick a letter in the sentence, or in the row beneath it. Each time it appears it lights up, one after another, and the count stops exactly at the number the sentence gives for that letter.

Only letters are counted, and capitals count with lower case. Rare letters such as j, k, q and z appear just once, at the very place where the sentence counts them: 8 of the 26 letters appear only once.

Why one is hard to write#

It looks easy: count the letters and write down the result. But the words that spell the numbers have letters too. If the sentence claimed one more e, it would have to say “thirty-four” instead of “thirty-three”. The new word brings in an f, an o and a u and takes away two e’s, an h and a t, and now other numbers are wrong. Every repair breaks something else.

Try it: pick a letter and move its number by one. The numbers that start to lie turn red, in the sentence and in the case.

+1

This short sentence contains three a’s, one b, three c’s, two d’s, thirty-three e’s, four f’s, two g’s, ten h’s, ten i’s, one j, one k, one l, one m, twenty-two n’s, sixteen o’s, one p, one q, nine r’s, twenty-five s’s, twenty-six t’s, two u’s, three v’s, eight w’s, three x’s, five y’s and one z.

Red in the case: letters beyond what the sentence claims, or empty places where letters are missing.

A sentence like this is a fixed point: count its letters, rewrite it with the numbers you found, and you get the same sentence back, letter for letter. Not every opening has one. Lee Sallows, who built a machine in 1983 to find one in English, found that, within his machine’s ranges, roughly one opening in ten had one.

How the machine finds a true sentence#

The machine here works the way Sallows worked with a pencil, only fast. It starts from guessed numbers, writes the sentence, counts its letters and replaces a few of the wrong numbers with the true ones. Then it goes round again with the new sentence. When it starts going in circles it gives up and starts afresh, sometimes with another opening: “This sentence contains”, “This sentence has”, “In this sentence there are”.

Red numbers are the ones that lie in the current attempt. The machine stops only when none of them lies, and after the sentence it found has been recounted letter by letter.

The sentence the machine is trying will appear here.

Lee Sallows first wrote a program that checked about ten combinations of numbers a second; by his own sum it would have needed 31.7 million years to try them all. So he built an electronic machine the size of a small suitcase, with more than two thousand components, which tried a million combinations a second, one after another, over narrower ranges of numbers. Its first search ran for 22 days and found nothing.

The machine here tries about 2.9 million combinations a second on a laptop, but not in order: each time it jumps towards the numbers the sentence really has. That is why it finds one in seconds instead of days. Some openings lead nowhere, though:

OpeningVersions that gave a sentenceTime (median)
“This sentence contains…”2 / 20.2 s
“This sentence has…”1 / 27.0 s
“In this sentence there are…”0 / 2–
“This line of text contains…”2 / 22.3 s
“This sentence is made of…”0 / 2–
“This sentence counts…”2 / 20.2 s
“Here is a sentence that contains…”2 / 20.4 s
“This short sentence contains…”2 / 20.3 s

Each version of an opening (with “and” or “, and” before z) was tried on its own for up to 20 seconds. Of 16 versions, 11 led to a sentence. In Romanian, 18 of 30.

A sentence written for a name#

Put a name at the start of the sentence and everything has to be redone: the letters of the name are counted too, and the numbers shift. The machine searches again from scratch, on your own phone or computer. The name goes nowhere. For 54 common names (first names, plus a few such as Mum and Grandma) the sentence has already been found and appears at once.

The sentence written for the name will appear here.

On a laptop, the machine found a sentence for 54 of the 57 names tried (common English first names, plus Mum, Dad, Grandma and Grandpa), typically in 0.5 seconds; the hardest name it solved took 3.7 seconds. A phone may take longer. While it searches, it shows how close it has come.

How the self-counting sentence began#

  1. 1982In January, Douglas Hofstadter’s Scientific American column carries a sentence by Lee Sallows, an electronics engineer, that counts its own letters and punctuation marks. It begins: “Only the fool would take trouble to verify…”.
  2. 1983In February the Dutch writer Rudy Kousbroek translates it in the newspaper NRC Handelsblad. A month later, in a second article, he writes a Dutch sentence that counts every letter of the alphabet, “Dit pangram bevat vijf a’s, twee b’s…”, and teases that Sallows “will doubtless find little difficulty” making one in English.
  3. 3 October 1983Sallows’ machine, built in three months, is switched on. By 25 October, 22 days later, it has tried every combination within its reach. No sentence.
  4. Mark IISallows rebuilds it to finish a search in 105 minutes and tries other openings: “comprises”, “consists of”, “is composed of”, “uses”, “employs”, “has”. None works. On the second day, during the eighth run, the “EUREKA!” lamp lights: “This pangram lists four a’s, one b, one c…”.
  5. Next dayThe machine also finds the English translation of Kousbroek’s sentence, with “&” instead of “and”: “This pangram contains four a’s, one b, two c’s…”.

Sallows called such a text an autogram, from the Greek autos, “self”, and gramma, “letter”.

The Romanian one#

Romanian is the language of this site, and its alphabet has 31 letters: the 26 of English plus ă, â, î, ș and ț, each counted on its own. Its numbers are long too. “Twenty-one times” is “de douăzeci și una de ori”, 20 letters against 9 for “twenty-one”, so every number drags in many d, e, o, r and i, which then have to be counted as well. In the Romanian sentence, d appears 49 times. Even so, the machine found a Romanian sentence for each of the 121 Romanian names it tried.

It opens „În această frază, litera a e scrisă de douăzeci și șase de ori…” (“In this sentence, the letter a is written twenty-six times…”). The Romanian edition has the whole sentence, ready to count.

Two earlier Romanian letter lists that count themselves, published in 2019 by Adrian Toncean, are collected on autograms.net, a site that gathers such sentences from many languages.

What is counted, and how#

What is counted. The 26 letters a to z. Capitals count with lower case. Spaces, commas, hyphens, apostrophes and the full stop are not counted. Accents are dropped from names (é becomes e).

How the machine searches. From guessed numbers, it writes the sentence, counts it, and puts the true number in place of one, two or three wrong ones. After 3,000 steps without success it starts again, with one of 16 equivalent openings. On a phone or computer several machines run at once, and the first to finish wins. Every sentence is recounted letter by letter before it appears. A sentence received through a link is recounted on arrival and is not shown unless it is true.

The timings. Measured on a laptop with an Apple M2 processor, one search at a time. Every search is different, so timings vary from run to run.

What is not known. When an opening gives no sentence within 20 seconds, it may still have one that is harder to find. The search does not prove that none exists.

Sources#

  1. Lee Sallows, “In Quest of a Pangram”, the author’s own account of the 1982 sentence, Rudy Kousbroek’s challenge and the 1983 machine, with every historical figure quoted here. leesallows.com
  2. A list of self-counting sentences by language, including the Romanian lists from 2019. autograms.net
  3. “Autogram”, Wikipedia, as a pointer to later work. en.wikipedia.org
  4. The Romanian orthographic dictionary (DOOM 3), for the feminine form “douăzeci și una de ori”. doom.lingv.ro