A cryptogram is a mathematical puzzle where various symbols are used to represent digits, and a given system has to be true. The most common form is a mathematical equation (as shown below), but sometimes there can be multiple equations or statements. Solving a cryptogram by hand usually involves a mix of logical deduction and exhaustive tests of remaining possibilities. Furthermore, keep in mind that a cryptogram could have no solutions, one unique solution, or even numerous solutions.
We will explore various techniques for tackling cryptograms, which provides you with a complete arsenal to solve cryptograms such as this:
For simplicity and consistency, we will assume the following:
- Each symbol represents a distinct, single, non-negative digit.
- All leading digits are non-zero unless stated otherwise.
- We read columns from the rightmost, so the units column is the first.
1) Converting Cryptogram to Equation
We will be applying some properties of simple equations for cryptogram. If you are not familiar with that concept, please see the main article first: Simple Equations.
To solve the above cryptogram for and we can interpret it as the sum of two integers. That is,
This gives . We can check individually and find that and gives a solution.
Find the value that represents the symbol .
Converting the cryptogram to an equation gives .
We then convert each of these 3-digit integers to an algebraic expression:
Thus, we have
2) Rearrangement of Columns
The above shows two cryptograms. For the left one, if we rearrange the digits/letters in their respective columns, we will obtain the cryptogram on the right. Be warned that we can only do this when it is a simple addition. This works because we have converted the cryptogram to an equation and then back to a revised cryptogram. Thus, solving for the unknown in the left one is equivalent to solving the right one. In this case, a simple algebra can solve it:
For the above cryptogram, find the value of and such that
Rearranging the digits in their respective columns, we can obtain the following cryptogram:
Interpreting this cryptogram shows that the sum of digits in any of the columns yields 6. Since and they are all single-digit positive integers such that , we have only.
Bonus: Try to solve the above example with 666 replaced by 777.
3) Carry Over
A carry is a digit that is transferred from one column of digits to another column of more significant digits.
For the cryptogram above, we can immediately show that without knowing the values of the other unknown letters! Here's how:
We can show that the sum of two 4-digit integers does not exceed . Also, since we know that is non-zero, is forced to be
The benefit of this technique is to restrict the possible values of unknown variables and thus make the puzzle easier to solve. More generally, we have the following theorem:
If we have positive integers such that they all have the same number of digits, the maximum value of the carryover of the sum of these numbers is
In the above cryptogram with some unknowns and find the value of
Using the concept of carryover that we've learned above, we can see that only.
Note: We can obviously solve for the other unknowns first. For example, from the first column and from the third column , which implies because we only take the last digit of for So the carry is . Then with carry over . Thus . But this method is much longer.
When the sum of four distinct 4-digit integers is equal to a five-digit number find the possible value(s) of the leading digit of
Using the concept of carryover, we figure that the maximum possible value of is
So, all the possible values of the leading digit of are and
From the above explanations, we know that . Using the concept of carryover, show that
Since there is a carry in the column, for the column must be less than or equal to . But all these distinct letters are of distinct values, so by reading the , we have , where is the carry over of the with or . Keep in mind that the only possible value of and are .
If , we have , or simply , which forces to take the value of 9 only and to take the value of .
If , we have , or simply , which forces to take the value of 8 only and to take the value of .
Either way, is the only possible solution.
This is a sum of positive integers with the same number of digits, so the carryover is either 0 or 1 only. So or only. If , then there will be a carry in column 3, implying would be less than or equals to which is impossible. So there's no carry over for the third column. Thus only.
Lastly, we refer to the third column. Since , there is a non-zero value of carry over, which implies Therefore,
4) Divisibility Rules
Like modular arithmetic, we will be applying some properties of divisibility rules for cryptogram. If you are not familiar with that concept, please see the main article first, Divisibility Rules.
By divisibility rule of since the last digit of the -digit number is at least one of the last digits of the two other numbers must end with Thus . Now, because the -digit number is divisible by its sum of digits must be divisible by as well. So is divisible by with a single-digit integer, which implies only.
The above shows an incomplete cryptogram. Find possible values of using the properties of divisibility rules alone.
Because is divisible by and is divisible by is divisible by This means that is divisible by implying the sum of its digits must be divisible by as well:
The above shows an incomplete cryptogram. Find the values of and using the properties of divisibility rules alone.
Because ends with a the -digit number is divisible by so the last digit of this number is either or only. Because it is a multiplication of an even number, the last digit must be so only.
Since , the -digit number is divisible by Thus, the sum of digits is divisible by as well. That is, only.
5) Factoring of Terms
In this section, we will take advantage of the factorization of integers to solve cryptograms.
For the above example, we have one -digit number and one -digit number such that their product equals to By prime factorization, we have (the number 211 can be easily verified to be a prime). Converting to the form as above, we either have or . So there exist two solutions, namely .
6) Modular Arithmetic
We will be applying some properties of modular arithmetic for cryptogram. If you are not familiar with that concept, please see the main article first, Modular Arithmetic.
The above shows an incomplete multiplication between two numbers, where we have not necessarily distinct single digit integers and . Because is divisible by and is divisible by , their product is divisible by . So must be divisible by . Thus by modular arithmetic, .
In our earlier example, we obtained and . Using this additional information, show that .
Suppose there were no carry in the column, then with Then we can simplify the congruence to , which implies . But this is a contradiction since already and all the letters must be distinct. So there is no carry in the column, which implies only.
Now, can you finish off the very first cryptogram above?
7) Chinese Remainder Theorem
For some cryptarithm involving multiplication, Chinese remainder theorem (CRT) will come in handy. It uses some properties of modular arithmetic. If you are not familiar with that concept, please see the main article first, Chinese Remainder Theorem.
With the same rules applied, can you solve this cryptarithm?
Notice that the last two digits of all these three numbers are the same. Writing it down in linear congrunce gives , or . Because and are consecutive, they must be coprime. With , we have
Solving via CRT gives only, implying . Can you finish out the solution by yourself?
8) Trial and Error
Sometimes, there could be no easy way to deal with a cryptogram, and the most we can do is to apply brute force approach and check each case to determine whether they yield a solution.
Take the above as an example, where could be any integer between and inclusive: . By trial and elimination, only. This is the simplest approach to tackle this problem because there is only one unknown to consider and this unknown is set up in such a way that other solving techniques will take longer.
9) Programming Approach
Sometimes, it would be more tedious to check for all possible cases like the trial and error approach. So it's not an ideal way to solve this and thus we need to apply other techniques. A viable approach is to use programming codes to solve it.
Find the values of the unknown letters represented in the cryptogram above.
1 2 3 4 5 6 7
from itertools import permutations for i in permutations('0123456789'): str = ''.join(i) [E,U,R,O,P,A,J,I,T,N]=list(str) if int(E+U+R+O+P+A)+int(J+U+P+I+T+E+R)==int(N+E+P+T+U+N+E): print (int(E+U+R+O+P+A))
The output is
10) Branch and Bound
There is a method called branch and bound that utilizes a technique from operations research. For the main article, refer to Branch and Bound.
The examples above in this wiki page show cryptograms that require only one technique. However, it will be trickier to solve a cryptogram that uses a mix of techniques, which is developed out in the follow-up page: Cryptogram - Problem Solving.
The techniques mentioned above in this page are sufficient enough to tackle all cryptogram problems. However, it is definitely beneficial to know which technique to use when solving a cryptogram. Here are a few good indicators on how to identify which techniques are useful when tackling a cryptogram:
|Technique||Type of problem||Conditions to apply|
|1) Converting cryptogram to equation||All||Few symbols, which occur 1-2 times each|
|2) Rearrangement of columns||At most 1-2 symbols in each column|
|3) Carry over||(Most useful technique) to identify additional constraints|
|4) Divisibility rules||A term has a factor with a simple rule of divisibility|
|5) Factoring of terms||If we know the entire term and can easily factorize it|
|6) Modular arithmetic||If we have a lot of information modulo a value (like 2, 3, 4, 5, 8)|
|7) Chinese remainder theorem||Last few digits of 2 or more numbers are the same|
|8) Trial and error||All||Few variables, but they occur many times|
|9) Programming approach||All||Any cryptogram will do|