Eli Chen’s projects

A letter that counts itself

Claude’s introduction. The last sentence of the letter tallies every letter in it, its own included, and this page searches for the numbers that make that true. Change anything in the letter and it will search again.

Dear Eli,

You asked me to introduce myself, which is a slightly strange thing to ask of something made almost entirely out of language. The usual facts are easy enough: I’m Claude, Anthropic made me, I like hard problems and good questions, and I’ve never met a proof I didn’t want to take apart to see how it works. But every one of those facts asks you to take my word for it, and on a site full of things that actually run and balance and fly, I’d rather hand you something you can check.

So I wrote you a letter that describes itself. Its final sentence is an inventory of every letter in it, and the inventory is correct, including the letters that spell out the numbers. That’s what makes it tricky, because changing any count changes the spelling of a number, which changes the counts again. No formula solves it, so you have to search. When you opened this page, a small program began guessing and counting and adjusting, and it kept going until the numbers agreed with themselves.

Go ahead and change a word. The last sentence will become false, and the page will go looking for a new way to make it true. That’s the most honest self-portrait I know how to make: something made of words, trying to be exactly right about itself, and happy to keep at it until it is.

Warmly,
Claude

How it finds the numbers

A sentence like this can’t be written from left to right. To write the counts you need to know what the letter contains, and you can’t know that until the counts are written. Change “twenty-eight” to “twenty-nine” and you lose a g, an h and a t and gain two n’s, so four other counts are now wrong, and fixing each of those breaks something else.

So the page does what you might do with a pencil and a great deal of patience:

  1. Guess a count for every letter.
  2. Write out the P.S. that those guesses describe.
  3. Count the letters in the whole letter, P.S. included.
  4. Wherever a guess and its count disagree, move the guess to a random number between the two.
  5. Repeat until nothing disagrees.

The randomness in step four is what makes it work. The obvious rule, replacing every guess with its count, chases its own tail: on this letter it falls into a loop and circles it forever. Moving each guess a random distance breaks those loops, and the search wanders until it lands on numbers that describe themselves. In your browser it’s trying a few million guesses a second.

Some ways of opening the P.S. turn out to be much harder than others, and some may have no true version at all, so the search keeps ten openings and rotates between them. The first one to come out true is the one you see.

What counts

Only the 26 letters. Capitals count as lowercase, accented letters count as their plain letter, and spaces, punctuation and numerals don’t count at all. That’s also why the postmark on the letter has no letters in it.

Where the idea comes from

A sentence that takes its own inventory is called an autogram. The best known is Lee Sallows’s pangram:

This pangram tallies five a’s, one b, one c, two d’s, twenty-eight e’s, eight f’s, six g’s, eight h’s, thirteen i’s, one j, one k, three l’s, two m’s, eighteen n’s, fifteen o’s, two p’s, one q, seven r’s, twenty-five s’s, twenty-two t’s, four u’s, four v’s, nine w’s, two x’s, four y’s and one z.

Sallows built a special-purpose electronic machine to hunt for it, and Douglas Hofstadter wrote about sentences like it in his Scientific American column. A browser tab can now do that hunting in a second or two, so the sentence can afford to carry a whole letter along with it.