## Self-Referential Puzzles - Solutions

Solutions were received from Denis Borris, Kirk Bresniker, Dave Ellis, Bert Sevenhant, and Phillipe Fondanaiche. The solutions are included with the puzzle descriptions below.
Update 4/22/03: Mark Moyer pointed out there are more "answers" to the initial puzzle "How many letters are in the answer to this question?":

Eight plus five.
Exactly twenty-four letters.
Roughly twelve.
At least ten.
If you're counting letter tokens, then eighty-one, but if you're counting letter types, then eighteen.
Just one more than are in the question to this answer!

Spelling puzzles

• How many letters are in the answer to this question? (Answer other than "Four" or "0".)
• Roman Numerals: i ii iii
• Two cubed (8)
• Thirteen plus two (15)
• Forty less twenty two (18)
• Twenty-four minus five (19)
• Twenty seven less seven (20)
• Two to the power four plus nine (25)
• Ten plus squareroot of four hundred (30)
• Thirty-one, if you count extra letters (31)
• The answer contains thirty four letters (34)
• There are thirty seven letters in the answer (37)
• There are exactly _____ E's in this sentence.
• nine
• nine plus one
• one times twelve
• There are _____ E's in this sentence.
• eight
• ten divided by one
• ten times one
• twelve less one
• This sentence uses _____ E's.
• seven
• And, this sentence has _____ E's.
• four
• five
• Can you find a representative "E" sentence for "two" through "twelve"?
• This E is at his own.
• This one has two E's.
• This words contain three E's.
• This is a sentence with four E's.
• This is a sentence with five E's.
• This had to become a sentence with six E's, but I can't find a sixth one, Oh, I did it!!!!
• Here you can find seven E's if I add another one.
• There are eight E's in this sentence.
• There are exactly nine E's in this sentence.
• It is hard to make a sentence with exactly ten E's, but here is one.
• Here is another different sentence with ten E's.
• Exactly eleven E's in one sentence, that is not evident.
• There are exactly twelve E's, here in this sentence.
• This sentence has _____ letters.
• thirty-one
• thirty-three
• I hesitate to ask this, but I am giving you three weeks. If only one of a letter exists, the letter should not be plural, as in "one Z", not "one Zs" (I have suggested some letters are singular below.) If some supporting words need to be changed/added/deleted to make it work, please do.

This sentence has _____ A's, _____ B's, _____ C's, _____ D's, _____ E's, _____ F's, _____ G's, _____ H's, _____ I's, _____ J, _____ K, _____ L's, _____ M's, _____ N's, _____ O's, _____ P's, _____ Q, _____ R's, _____ S's, _____ T's, _____ U's, _____ V's, _____ W's, _____ X's, _____ Y's, and _____ Z.

• From rec.puzzles:
• 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.
• This computer-generated pangram contains six a's, one b, three c's, three d's, thirty-seven e's, six f's, three g's, nine h's, twelve i's, one j, one k, two l's, three m's, twenty-two n's, thirteen o's, three p's, one q, fourteen r's, twenty-nine s's, twenty-four t's, five u's, six v's, seven w's, four x's, five y's, and one z.
• This pangram lists four a's, one b, one c, two d's, twenty-nine e's, eight f's, three g's, five h's, eleven i's, one j, one k, three l's, two m's twenty-two n's, fifteen o's, two p's, one q, seven r's, twenty-six s's, nineteen t's, four u's, five v's, nine w's, two x's, four y's, and one z.
• This pangram contains four a's, one b, two c's, one d, thirty e's, six f's, five g's, seven h's, eleven i's, one j, one k, two l's, two m's eighteen n's, fifteen o's, two p's, one q, five r's, twenty-seven s's, eighteen t's, two u's, seven v's, eight w's, two x's, three y's, & one z.
• This sentence is clearly made up using iv a's, i b, iii c's, iii d's, vi e's, i f, iii g's, iii h's, l i's, i j, i k, iv l's, ii m's, vi n's, ii o's, ii p's, i q, iii r's, xxiv s's, iv t's, iii u's, viii v's, i w, iii x's, ii y's and i z, right on ?
From Philippe Fondanaiche:
• Replace the ? and ?? by the appropiate words.
THERE ARE ? H'S IN THE ?? SENTENCE
THERE ARE ? F'S IN THE ?? SENTENCE
THERE ARE ? T'S IN THE ?? SENTENCE
THERE ARE ? E'S IN ALL THE SENTENCES

? represents any integer number, spelled.
?? is "first" or "second" or "third" or "last"
• There are three H's in the last sentence
There are two F's in the third sentence
There are five T's in the first sentence
There are thirty two E's in all the sentences
• There are three H's in the second sentence
There are two F's in the third sentence
There are four T's in the first sentence
There are thirty two E's in all the sentences

Digit Puzzles (fill the blanks with digits 0-9, or possibly multi-digit numbers):
• This sentence has __ 0's, __ 1's, __ 2's, __ 3's, __ 4's, __ 5's, __ 6's, __ 7's, __ 8's, and __ 9's.
• This sentence has 1 0, 7 1's, 3 2's, 2 3's, 1 4, 1 5, 1 6, 2 7's, 1 8 and 1 9.
• This sentence has 1 0, 11 1's, 2 2's, 1 3, 1 4, 1 5, 1 6, 1 7, 1 8, and 1 9.
• This sentence has __ zeros, __ ones, __ twos, __ threes, __ fours, __ fives, __ sixes, __ sevens, __ eights, and __ nines.
• This sentence has 6 zeros, 2 ones, 1 two, 0 three, 0 four, 1 six, 0 seven, 0 eight and 0 nine.
From Philippe Fondanaiche:
• Consider the following table:
```      -----------------------------------------
| 8 | 2 | 5 | 9 | 3 | 2 | 1 | 8 | 7 | 2 |
-----------------------------------------
|   |   |   |   |   |   |   |   |   |   |
-----------------------------------------```
In the first row there is the 10-digit number 8259321872. In the second row, the first square contains the digit (< 10) which shows the number of 0's in the 2 rows, the second square contains the digit which indicates the number of 1's in the 2 rows....., the last one shows the number of 9's. Field this table.
• ```I 8 I 2 I 5 I 9 I 3 I 2 I 1 I 8 I 7 I 2 I
I 1 I 6 I 5 I 1 I 0 I 2 I 1 I 1 I 2 I 1 I```
• Field the third row of the table whose the 2 first rows are 4942149894 and 1581847443.
• ```I 4 I 9 I 4 I 2 I 1 I 4 I 9 I 8 I 9 I 4 I
I 1 I 5 I 8 I 1 I 8 I 4 I 7 I 4 I 4 I 3 I
I 1 I 8 I 1 I 1 I 9 I 1 I 0 I 1 I 4 I 4 I```
• Build the last row of a table having the maximum number of 10-digit rows. [Remember each entry in the last row is a single digit, referring to the entire table.]
• Maximum number of rows: 7 excluding the last row used for the enumeration of the digits
```I 0 I 0 I 0 I 0 I 0 I 0 I 0 I 0 I 8 I 8 I
I 1 I 1 I 1 I 1 I 1 I 1 I 1 I 1 I 1 I 8 I
I 2 I 2 I 2 I 2 I 2 I 2 I 2 I 2 I 2 I 8 I
I 3 I 3 I 3 I 3 I 3 I 3 I 3 I 3 I 3 I 8 I
I 4 I 4 I 4 I 4 I 4 I 4 I 4 I 4 I 4 I 8 I
I 5 I 5 I 5 I 5 I 5 I 5 I 5 I 5 I 5 I 8 I
I 6 I 6 I 6 I 6 I 6 I 6 I 6 I 6 I 6 I 8 I
I 9 I 9 I 9 I 9 I 9 I 9 I 9 I 0 I 9 I 8 I```

Self-Referential Numbers
213 can be described as having "One 1, One 2, One 3", or 111213. In a successive list, with each line describing the previous, we get:
213
11 12 13
41 12 13
31 12 13 14
41 12 23 14
31 22 13 24
21 32 23 14
... and the last number (21322314) describes itself.
• What is the largest self-referential number? If you can show they can be arbitrarily large, what is the largest with less than 20 digits?
• 10 111 22 13 14 15 16 17 18 19 with 21 digits
• 10 71 32 23 14 15 16 27 18 19 with 20 digits
• 111 12 13 14 15 16 17 18 19 with 19 digits
• 22 with 2 digits is the shortest.
• Does every list, as above, terminate in a single self-referential number? Or can you find a non-terminating list, or an especially long list?
• It appears that all lists must terminate or cycle. One long list can be generated with 9090:
```20 29
10 22 19
10 21 22 19
10 31 32 19
10 31 12 23 19
10 41 22 23 19
10 31 32 13 14 19
10 51 12 33 14 19
10 51 12 23 14 15 19
10 61 22 13 14 25 19
10 51 32 13 14 15 16 19
10 71 12 23 14 25 16 19
10 61 32 13 14 15 16 17 19
10 81 12 23 14 15 26 17 19
10 71 32 13 14 15 16 17 18 19
10 91 12 23 14 15 16 27 18 19
10 81 32 13 14 15 16 17 18 29
10 81 22 23 14 15 16 17 28 19
10 71 42 13 14 15 16 17 28 19 = A
10 81 22 13 24 15 16 27 18 19 = B
10 71 42 13 14 15 16 17 28 19 = A
etc...```
Can anyone find longer than 21 steps?

• Can you find a cycle of numbers (A describes B describes C ... describes A)?
• On 7/2/98, Dave Ellis sent the following comment:
You mentioned you were looking for self-referential number series of terminating in an ABCA sequence (what I describe as cycle length 3.) There's hundreds of 'em! The lowest starts with 50 and terminates with 10512223142516, 10414213142516, 10512213341516, 10512223142516 ..., having only 13 terms in the series.

I haven't found any numbers with cycle-length longer than 3. Is there a mathematical proof that this is always so? Is there a proof that the longest is 21 terms, and that all series always terminate?

[I'd be interested in any longer cycles, or the proofs Dave mentions. - KD].

Update 10/3/00 - Ulrich Schimke sent several more analyses to add to the self-referential numbers:
```I found your article about self referential numbers in 980608 and I have some
facts to supplement.
To shorten things I denote with T the describing operator for integers, so
T(1334) = 112314, T(22) = 22 and so on.

1) There are exactly 109 fixed-points (= self-refential numbers), i.e. n with
T(n) = n. I examined this topic about a year ago and sent this sequence to
Neil Sloane. They are sequence A047841, see
http://www.research.att.com/cgi-bin/
access.cgi/as/njas/sequences/eisA.cgi?Anum=A047841
these fixed-points as input for a search engine e.g. 21322314.

2) You ask if the list always ends in fixed-point or a cycle. The answer is
Yes. This is a consequence from 2 facts: A) For every n with more than 21
digits T(n) < n is valid and B) For every n with not more than 21 digits,
T(n) has also not more than 21 digits. As a consequence the sequence n, T(n),
T(T(n)) ... enters and than remains in the bounded area from 1 to 10^21, so
it must end in a cycle (see a fixed-point as a 1-cycle)
To show A) and B) consider that T(n) has a maximum nuber of digits if the
digits in n are distributed as equal as possible. If you have for example
already 100 '2's in n you need another 900 '2's to "generate" a new digit in
T(n). But if you have just 10 '2's in n you need only 90 other '2's to get a
new digit in T(n). If n has k digits, T(n) reaches the maximum number of
digits if eyery digit occurs at least int(k/10)-times. This leads to A) and
B)

3) You ask if the number of steps until a list with a certain integer as
start can have a length > 21. The answer is the list can be abitrarly large.
For every a(1) > 22 not ending with a zero, there is a a(2) > a(1) with
T(a(2)) = a(1) and a(2) not ending with a zero as well. Iterating this
process you find a sequence of numbers a(1) < a(2) < a(3) < a(4) < .. with
T(a(2)) = a(1), T(T(a(3)) = a(1), T(T(T(a(4))) = a(1) and so on. So the
"pre"-phase before reaching the cycle can be abitrarly large, because the
cycle doesn't start until a(1). Finding a(2), a(3), ...  is easy: Let's start
e.g. with a(1) = 41.  Then a(2) is of course 1111. a(3) is 11111......111111
(the number consisting of 111 '1's). a(4) is the integer consisting of
(10^111-1)/9 '1's and so on.

4) I don't know if there are any terminating cycles with lengths other than 1
or 3. One has "only" to examine all numbers smaller than 22 digits. But this
is too much for a progam. But if you start examining all numbers beginning
with 1 you can stop examining a number n if T(n) < n cause T(n) has already
be checked. This reduces the nessecary run time for the program, but I think
this is still too much.
```

If you find other puzzles of this sort, feel free to submit them. I'll add them when I can.

Source: Unless noted, these are original.

Mail to Ken