# Cryptarithms

What general strategies are there for solving cryptarithms? How can we rank or classify cryparithms, based on difficulty or prereqs?

Problem:

AB - BA = A

Solution:

First, notice that we have (10A + B) - (10B + A) = 9(A - B) = A, and thus, A is a multiple of 9. But A is a single digit, and so A = 9. Now we have 9(9 - B) = 9, and so B = 8. In summary, A = 9, B = 8.

Strategy 1:

Express each number algebraically, then factor to reveal proper divisors.

Problem:

HEN + E = EGG

Solution:

Start by writing this in column form:

   HEN
+    E
------
EGG

Notice that in the tens column, the E drops down to become G. Thus, there must be a carry in the tens column. The same logic applies to the hundreds column. From this observation, the tens column tells us that E + 1 = 10 + G, and thus, E = 9 + G. But E is a single-digit number, and so G = 0, and E = 9.

   H9N
+    9
------
900

From the ones column, we see N + 9 = 10, and so N = 1.

   H91
+    9
------
900

From the hundreds column, H + 1 = 9, and so H = 8. In summary, G = 0, E = 9, N = 1, H = 8.

Strategy 2:

Write in column form. Identify carries to form equations.

Problem:

DAD + DAD + DAD + DAD + DAD = GLAD

Solution:

5 * D = D, so D = 0 or 5. But D appears as the first digit in DAD, and thus, since leading 0s are not allowed in cryptarithms, we have D = 5.

5A5 * 5 = GLA5

5 * 5 = 25, so the 2 carries to the tens column. Again looking at the tens column, we notice 5 * A + 2 ends in A. 5 * A ends in 0 or 5, so 5 * A + 2 ends in 2 or 7. If A = 2, then 525 * 5 = 2625 = GL25. But then A would be equal to G, which is not allowed. If A = 7, instead, then 575 * 5 = 2875 = GLAD.

Strategy 3:

List the possibilities for the last digit of a product.

Strategy 4:

Try all remaining combinations.

Problem:

AB + BA = (A + B)(A + B)

Solution:

Looking at the left-hand side, we notice 10A + B + 10B + A = 11(A + B), is a multiple of 11. Looking at the right-hand side, we have (A + B)^2, and this too must be a multiple of 11. The largest A + B can be, is 9 + 8 = 17. But the only positive multiple of 11, which is also less than or equal to 17, is 11. Thus, A + B = 11. Because AB and BA appear on the left-hand side, we know A ≠ 0, and B ≠ 0. These are the only three conditions, and thus we can now enumerate all solutions:

A = 9, B = 2
A = 8, B = 3
...
A = 2, B = 9

Strategy 5:

Find all necessary conditions, then enumerate all solutions.

Problem:

A + A + A = BA

Solution:

Rewriting shows 3 * A = 10 * B + A. Subtract A from both sides, to get 2 * A = 10 * B. Divide both sides by 2 to get A = 5 * B. Because the right-hand side is a multiple of 5, A = 0 or 5. But if A = 0, then B = 0, which is not allowed. Thus A = 5 and B = 1.

Problem:

BB + A = ACC

Solution:

Start by rewriting in column form:

   BB
+   A
-----
ACC

Notice that the tens column and hundreds column must each involve a carry. But a 2 digit number plus a 1 digit number can't be 200 or more, and thus, A = 1. But then the carries identified previously, and the ones column, tell us B = 9. Thus C = 0. In summary, A = 1, B = 9, C = 0.

Strategy 6:

When adding two numbers arranged in column form, if a certain column has exactly one addend digit in that column, and the sum digit in that column is not equal to the addend digit, then that column must have received a carry from the column one space to the right.

Strategy 7:

When adding an x digit number with a y digit number, to obtain a z digit number, if x and y are less than z, then the leading digit of z must be 1.

Problem:

AB + A = BCC

Solution:

The previous cryptarithm was BB + A = ACC. Interchange As and Bs to get AA + B = BCC. Notice this is the same as AB + A = BCC, the problem we're trying to solve. Thus, A = 9, B = 1, C = 0.

Strategy 8:

Use the solution from an isomorphic cryptarithm previously solved.

Problem:

AB + A = CDC

Solution:

C = 1

AB + A = 1D1

The only way to get a 1 in the hundreds place, is to have A = 9.

9B + 9 = 1D1

thus, B = 2.

92 + 9 = 101 = 1D1

so D = 0. In summary, A = 9, B = 2, D = 0.

Problem:

AB + BC = BCB

Solution:

B = 1

A1 + 1C = 1C1

Write in column form:

   A1
+  1C
-----
1C1

The only way to end with a 1 in the rightmost column, is if C = 0.

   A1
+  10
-----
101

From here, it's obvious that A = 9. In summary, B = 1, C = 0, A = 9.

Problem:

AB + CB = BA

Solution:

Rewrite the problem in column form:

  AB
+ CB
----
BA

Looking at the ones column, we notice A is even. In the leftmost column, A and C are the addend digits, and B is the sum digit. Thus B is greater than A and C. Also, A != 0, and C != 0, as they're leading digits. Looking back at the ones column, we now know that B >= 6. Thus, A = 2, 4, 6, or 8. C must satisfy A + C + 1 = B, which is the same thing as C = B - A - 1. But remember, C != 0, so B = 9, A = 8 is impossible. Enumerating all remaining possibilities:

B = 6, A = 2, C = 3
B = 7, A = 4, C = 2
B = 8, A = 6, C = 1

Strategy 9:

The sum digit in the leftmost column is greater than each addend digit in the leftmost column.

Problem:

AB + CB = BBA

Solution:

This problem is easy using all the strategies already laid out.

AB + CB = BBA

A1 + C1 = 11A

21 + C1 = 112

21 + 91 = 112

Thus, B = 1, A = 2, C = 9.

Problem:

AB + AB + AB + AB = CA

Solution:

  AB
AB
AB
+ AB
----
CA

Looking at the tens column, we notice A != 0, and 4 * A < 10, which tells us A = 1 or 2. Now looking at the ones column, we notice 4 * B is a multiple of 4. Every multiple of 4 is even, and thus always has an even final digit. Thus, A != 1. We also notice that if A = 2, then 4 * B >= 10. Looking at the last digit in the single-digit multiples of 4, we find B = 3. Thus

23 * 4 = 92

so C = 9. In summary, A = 2, B = 3, C = 9.