CEMC Banner

Problem of the Week
Problem D
Approved!

Debit and credit cards contain account numbers which consist of many digits. When purchasing items online, you are often asked to type in your account number. Because there are so many digits, it is easy to type the number incorrectly. The last digit of the number is a specially generated check digit which can be used to quickly verify the validity of the number. A common algorithm used for verifying numbers is called the Luhn Algorithm. A series of operations are performed on the number and a final result is produced. If the final result ends in zero, the number is valid. Otherwise, the number is invalid.

The steps performed in the Luhn Algorithm are outlined in the flowchart below. Two examples are provided.


The flowchart for the algorithm with the steps outlined in the adjacent text.

Example 1:

Number: \(135792\)

Reversal: \(\textcolor{red}{2}9\textcolor{red}{7}5\textcolor{red}{3}1\)

\(\begin{aligned} A&=\textcolor{red}{2+7+3}\\ &=12\\ \end{aligned}\)

\(\begin{aligned} 2\times9&=18\\ 2\times5&=10\\ 2\times1&=2\\ \end{aligned}\)

\(\begin{aligned} B&=(1+8)+(1+0)+2\\ &=9+1+2\\ &=12\\ \end{aligned}\)

\(C=12+12=24\)

\(C\) does not end in zero.

The number is not valid.

Example 2:

Number: \(1357987\)

Reversal: \(\textcolor{red}{7}8\textcolor{red}{9}7\textcolor{red}{5}3\textcolor{red}{1}\)

\(\begin{aligned} A&=\textcolor{red}{7+9+5+1}\\ &=22\\ \end{aligned}\)

\(\begin{aligned} 2\times8&=16\\ 2\times7&=14\\ 2\times3&=6\\ \end{aligned}\)

\(\begin{aligned} B&=(1+6)+(1+4)+6\\ &=7+5+6\\ &=18\\ \end{aligned}\)

\(C=22+18=40\)

\(C\) ends in zero.

The number is valid.

The number \(8763\,D8D4\,D6D8\,0459\) is a valid number when verified by the Luhn Algorithm. \(D\) is an integer from 0 to 9 occurring four times in the number. (It may also be one of the existing known digits.) Determine all possible values of \(D\).