August 2024
—————————
In the Math Corner of my August 2024 Diary I posted the following brainteaser.
Brainteaser. I don't think I have ever put a cryptarithmetic puzzle in this spot; so now, with … acknowledgments to Manan Shah, here is one.
The ten letters D, E, H, I, L, N, O, R, T, and W represent the ten decimal digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 in some order: one digit per letter, one letter per digit. The following sum is true, and the solution is unique. There are no leading zeroes. Find the values of D, E, H, I, L, N, O, R, T, and W.
N I NTH
+ N I NTH
+ N I NTH
+ TH I RD
+ TH I RD
—————
WHOLE
—————————
¶ Solution.
Solving cryptarithmetic puzzles — "cryptarithms" for short — rarely depends on flashes of inspiration. You just have to beat the darn things to death.
¶ Preamble: I need some language to deal with this one.
- Since both the digit zero and the uppercase letter "O" play roles in the puzzle, to avoid confusion I'll write zero as
"Ø."
- I'll refer to the five columns of the sum as, from left to right, "column 1," "column
2," …
- Since it's addition we are doing, there may be numbers "carried" from a column to the column at its immediate left. I'll
refer to these carries with lower-case "c" as c1, c2, c3, and c4. There is of course no carry
digit under column 5.
How big can these carry numbers be? Well, since every column has the form 3X+2Y, with X and Y different single digits, the biggest possible value for 3X+2Y is when X=9, Y=8, giving 43. So each carry number is either Ø, 1, 2, 3, or 4.
OK, let the beating commence!
¶ Column 1: I'll work the columns, beginning with column 1, the leftmost.
Column 1 adds up to 3N+2T+c1. There are only five digits in WHOLE, so this sum must be a one-digit number; and since there are no leading zeroes, neither N nor T can be Ø.
If c1 is 4, 3N+2T can be at most 5. This is not possible with different N and T.
If c1 is 3, 3N+2T can be at most 6; also not possible.
So c1 is Ø, 1, or 2.
This gives just six possibilities for (N, T, c1, W).
(1, 3, Ø, 9)
(2, 1, Ø, 8)
(1, 2, Ø, 7)
(2, 1, 1, 9)
(1, 2, 1, 8)
(1, 2, 2, 9)
¶ Column 2: Shifting attention to column 2, the first thing to be said about it actually relates to column 1. It is: c1 can't be Ø.
Why can't c1 be Ø? Because column 2 tells us that 3I+2H+c2 gives us digit H in the total. That's only possible if there's a carry digit — if, in other words, 3I+2H+c2 = 1Ø+H or 2Ø+H or 3Ø+H or 4Ø+H. So c1 can't be Ø.
That trims down the possibilities for (N, T, c1, W) to
(2, 1, 1, 9)(1, 2, 1, 8)
(1, 2, 2, 9)
OK, now I can concentrate on column 2, right? Well, yes; but first, glancing rightwards to column 3, I see that c2 can't be bigger than 2.
Why not? Because column 3 adds to 3N+2I+c3. We know that N is at most 2. Even with the biggest possible values of I and c3 that only adds to 28.
Column 2 sums to 3I+2H+c2, and the total is some number whose "units" digit is H. A moment ago I expressed that fact like this: 3I+2H+c2 = 1Ø+H or 2Ø+H or 3Ø+H or 4Ø+H. To simplify, I can just subtract an H from both sides of the equals sign in each case, giving me
3I+H+c2 = 1Ø, 2Ø, 3Ø, or 4Ø.
I can forget about the 40. 3I+2H+c2=40 with c2=Ø, 1, or 2 would mean 3I+2H=40 or 39 or 38. There are no solutions for that with single-digit I and H.
Given that 1 and 2 are spoken for (they are N and T in some order) and neither c1 nor c2 can be bigger than 2, how many possibilities are there? I make it ten. Expressed as (I, H, c1, c2, 3I+2H+c2), they are:
(4, 8, 2, 2, 28)
(0, 9, 1, 1, 19)
(3, 0, 1, 1, 10)
(4, 7, 2, 1, 27)
(5, 4, 2, 1, 24)
(0, 8, 1, 2, 18)
(6, 0, 2, 2, 20)
(4, 6, 2, 2, 26)
(3, 9, 2, 2, 29)
(5, 3, 2, 2, 23)
Sure enough: scrutinizing the last number in each of those brackets, I see that its "tens" digit is c1 and its "units" digit is H.
¶ Column 3: Onwards to column 3.
First let's get a handle on c3, the carry digit at the bottom of column 3. It is of course the "tens" digit from adding up 3T+2R+c4. Since T is at most 2 and R at most 9 and c4 at most 4, 3T+2R is at most 28, so c3 is at most 2.
I'm now going to enlarge that list of ten possibilities I just produced. Into each bracket I'll inset N in the first position and the total sum of column 3, including carry digit, in the last position. So now it is a list of (N, I, H, c1, c2, 3I+2H+c2, 3N+2I+c3). Unfortunately, since N can be either 1 or 2, the list is not only broader, it's now twice as long.
(1, 4, 8, 2, 2, 28, 11+c3)
(1, 0, 9, 1, 1, 19, 3+c3)
(1, 3, 0, 1, 1, 10, 9+c3)
(1, 4, 7, 2, 1, 27, 11+c3)
(1, 5, 4, 2, 1, 24, 13+c3)
(1, 0, 8, 1, 2, 18, 3+c3
(1, 6, 0, 2, 2, 20, 15+c3)
(1, 4, 6, 2, 2, 26, 11+c3)
(1, 3, 9, 2, 2, 29, 9+c3)
(1, 5, 3, 2, 2, 23, 13+c3)
(2, 4, 8, 2, 2, 28, 14+c3)
(2, 0, 9, 1, 1, 19, 6+c3)
(2, 3, 0, 1, 1, 10, 12+c3)
(2, 4, 7, 2, 1, 27, 14+c3)
(2, 5, 4, 2, 1, 24, 16+c3)
(2, 0, 8, 1, 2, 18, 6+c3
(2, 6, 0, 2, 2, 20, 18+c3)
(2, 4, 6, 2, 2, 26, 14+c3)
(2, 3, 9, 2, 2, 29, 12+c3)
(2, 5, 3, 2, 2, 23, 16+c3)
Whoa, this is getting out of control. Let's not panic, though. We can cull those twenty possibilities.
The "tens" digit of the column 3 total is, by definition, c2, so it must match the fourth number in each bracket, which is c2 by definition.
That culls the twenty possibilities for (N, I, H, c1, c2, 3I+2H+c2, 3N+2I+c3) down to just five.
(1, 4, 7, 2, 1, 27, 11+c3)
(1, 5, 4, 2, 1, 24, 13+c3)
(2, 4, 7, 2, 1, 27, 14+c3)
(2, 5, 4, 2, 1, 24, 16+c3)
(2, 6, Ø, 2, 2, 2Ø, 18+c3)
Note that in every one of these cases, c1 is 2. Looking back to my researches on column 1 I see that (N, T, c1, W) must then be (1, 2, 2, 9). So N=1, T=2, W=9, and only the first two items on my list are possible: (N, I, H, c1, c2, 3I+2H+c2, 3N+2I+c3) is either (1, 4, 7, 2, 1, 27, 11+c3) or (1, 5, 4, 2, 1, 24, 13+c3)
We can just try these two possibilities in turn.
¶ Dénouement: Trial & error.
The first of those two possibilities leaves digits Ø, 3, 5, 6, and 8 still unaccounted for; the second leaves Ø, 3, 6, 7, and 8.
At this point I just rewrote the two sums as they appear in those two cases, and ran trial & error on the unaccounted-for digits. The first possibility makes the sum look this:
1 4 1 2 7
1 4 1 2 7
1 4 1 2 7
2 7 4 R D
2 7 4 R D
—————
9 7 O L E
with digits Ø, 3, 5, 6, and 8 still unaccounted for
D=Ø or 5 gives E=1; D=3 or 8 gives E=7. Since 1 and 7 are already accounted for, D must be 6, making E=3. That carries 3, so column 4 is 9+2R.
With 6 and 3 now also spoken for, R is 0, 5, or 8, giving 9+2R equal to 9, 19, or 25 and so L=9 or 5. Since W=9, R must be 8 and L=5, carrying 2 to column 3. But that makes column 3 add to 13, implying O=3, and we already have E=3 …
So the first of our possibilities can't be made to work. We must rest our hope in the second. Here the sum looks like this:
1 5 1 2 4
1 5 1 2 4
1 5 1 2 4
2 4 5 R D
2 4 5 R D
—————
9 4 O L E
with digits Ø, 3, 6, 7, 8 still unaccounted for
Two minutes trial & error delivers the solution:
1 5 1 2 4
1 5 1 2 4
1 5 1 2 4
2 4 5 Ø 7
2 4 5 Ø 7
—————
9 4 3 8 6