Jordan dropped their phone, and now the touchscreen is badly damaged. The left and centre columns of the number pad are completely unresponsive. Only the right-hand column, containing the digits \(3\), \(6\), and \(9\), is still functioning. Jordan wants to set a new \(4\)-digit lock screen PIN using only the working numbers. Jordan sets two rules for the PIN:
A single digit can occur at most three times in the PIN (for example, \(9999\) is not allowed).
The \(4\)-digit PIN must be divisible by \(9\).
How many different \(4\)-digit PINs can Jordan create?
Did You Know?
If the sum of the digits of a number is divisible by \(9\), then the number is divisible by \(9\). If the sum of the digits of a number is not divisible by \(9\), then the number is not divisible by \(9\).
For example, the number \(10\,278\) is divisible by \(9\) since the sum of the digits is \(1+0+2+7+8= 18\), which is divisible by \(9\). However, since the sum of the digits of the number \(12\,345\) is \(15\) and \(15\) is not divisible by \(9\), then the number \(12\,345\) is not divisible by \(9\).
Solution 1
In this solution we consider the possible sums that the digits of the PIN can add to.
The minimum digit sum would be created using three \(3\)s and one \(6\), yielding a sum of \(15\). The maximum digit sum would be created using three \(9\)s and one \(6\), yielding a sum of \(33\). Neither of these sums are divisible by \(9\). However, between \(15\) and \(33\), there are two numbers, namely \(18\) and \(27\), which are divisible by \(9\). We are therefore looking for four digits whose sum is either \(18\) or \(27\). The following table summarizes the possible digit combinations and the resulting sums.
| Number of \(\boldsymbol{3}\)s | Number of \(\boldsymbol{6}\)s | Number of \(\boldsymbol{9}\)s | Digit Sum | Divisible by \(\boldsymbol{9}\)? |
|---|---|---|---|---|
| \(3\) | \(1\) | \(0\) | \(3+3+3+6=15\) | No |
| \(3\) | \(0\) | \(1\) | \(3+3+3+9=18\) | Yes |
| \(1\) | \(3\) | \(0\) | \(3+6+6+6=21\) | No |
| \(0\) | \(3\) | \(1\) | \(6+6+6+9=27\) | Yes |
| \(1\) | \(0\) | \(3\) | \(3+9+9+9=30\) | No |
| \(0\) | \(1\) | \(3\) | \(6+9+9+9=33\) | No |
| \(2\) | \(2\) | \(0\) | \(3+3+6+6=18\) | Yes |
| \(2\) | \(0\) | \(2\) | \(3+3+9+9=24\) | No |
| \(0\) | \(2\) | \(2\) | \(6+6+9+9=30\) | No |
| \(2\) | \(1\) | \(1\) | \(3+3+6+9=21\) | No |
| \(1\) | \(2\) | \(1\) | \(3+6+6+9=24\) | No |
| \(1\) | \(1\) | \(2\) | \(3+6+9+9=27\) | Yes |
Now, we can create the numbers using the information in the rows of the table in which the sum of the digits is divisible by \(9\).
First we can create all four-digit numbers having three \(3\)s and one \(9\). The numbers are \(3339\), \(3393\), \(3933\), and \(9333\). There are \(4\) possible numbers.
Then we can create all four-digit numbers having three \(6\)s and one \(9\). The numbers are \(6669\), \(6696\), \(6966\), and \(9666\). There are \(4\) possible numbers.
We continue by creating the four-digit numbers which contain two \(3\)s and two \(6\)s. The numbers are \(3366\), \(3636\), \(3663\), \(6633\), \(6363\), and \(6336\). There are \(6\) possible numbers.
Finally, we create all numbers containing two \(9\)s, one \(3\) and one \(6\). The numbers are \(9936\), \(9963\), \(9396\), \(9693\), \(9369\), \(9639\), \(3996\), \(6993\), \(3969\), \(6939\), \(3699\), and \(6399\). These numbers can be created systematically by placing the \(9\)s in the six possible ways in a four-digit number. Then, for each of these ways of placing the \(9\)s, the \(3\) and \(6\) can be filled in the remaining two spots in two ways. There are a total of \(12\) possible numbers.
Combining the results, there are \(4+4+6+12= 26\) possible PINs.
Solution 2
In this solution, we consider cases based on the number of \(9\)s in the PIN.
Case 1: The number contains three \(9\)s.
In this case the digit sum is \(27\)
plus the value of the fourth digit.
If the fourth digit is a \(3\), the digit sum is \(30\). Since \(30\) is not divisible by \(9\), there is no possible PIN using these digits.
If the fourth digit is a \(6\), the digit sum is \(33\). Since \(33\) is not divisible by \(9\), there is no possible PIN using these digits.
This case produces no possible PINs.
Case 2: The number contains two \(9\)s.
In this case the digit sum is \(18\)
plus the sum of the two remaining digits.
If the two remaining digits are both \(3\)s, the digit sum is \(24\). Since \(24\) is not divisible by \(9\), there is no possible PIN using these digits.
If the two remaining digits are both \(6\)s, the digit sum is \(30\). Since \(30\) is not divisible by \(9\), there is no possible PIN using these digits.
If one of the remaining digits is a \(3\) and the other digit is a \(6\), the digit sum is \(27\). Since \(27\) is divisible by \(9\), possible PINs exist using these digits. There are twelve possible PINs: \(9936\), \(9963\), \(9396\), \(9693\), \(9369\), \(9639\), \(3996\), \(6993\), \(3969\), \(6939\), \(3699\), and \(6399\). These numbers can be created systematically by placing the \(9\)s in the six possible ways in a four-digit number. Then, for each of these ways of placing the \(9\)s, the \(3\) and \(6\) can be filled in the remaining two spots in two ways.
This case produces \(12\) possible PINs.
Case 3: The number contains one \(9\).
In this case the digit sum is \(9\)
plus the sum of the three remaining digits.
If each of the three remaining digits is a \(3\), the digit sum is \(18\). Since \(18\) is divisible by \(9\), possible PINs exist using these digits. There are four possible PINs: \(3339\), \(3393\), \(3933\), and \(9333\).
If each of the three remaining digits is a \(6\), the digit sum is \(27\). Since \(27\) is divisible by \(9\), possible PINs exist using thee digits. There are four possible PINs: \(6669\), \(6696\), \(6966\), and \(9666\).
If one of the remaining digits is a \(3\) and each of the other two remaining digits is a \(6\), the digit sum is \(24\). Since \(24\) is not divisible by \(9\), there is no possible PIN using these digits.
If one of the remaining digits is a \(6\) and each of the other two remaining digits is a \(3\), the digit sum is \(21\). Since \(21\) is not divisible by \(9\), there is no possible PIN using these digits.
This case produces \(8\) possible PINs.
Case 4: The number contains no \(9\)s.
In this case the digit sum is the sum of the four remaining digits.
If the number contains three \(3\)s and one \(6\), the digit sum is \(15\). Since \(15\) is not divisible by \(9\), there is no possible PIN using these digits.
If the number contains three \(6\)s and one \(3\), the digit sum is \(21\). Since \(21\) is not divisible by \(9\), there is no possible PIN using these digits.
If two of digits are \(6\)s and two of the digits are \(3\)s, the digit sum is \(18\). Since \(18\) is divisible by \(9\), possible PINs exist using these digits. There are \(6\) possible numbers: \(3366\), \(3636\), \(3663\), \(6633\), \(6363\), and \(6336\).
This case produces \(6\) possible PINs.
Combining the results from the four cases, there are \(0+12+8+6= 26\) possible PINs that Jordan can create.