Link to the host of this site- Marist College This project was supported by a grant (DUE #9752632) from the National Science Foundation.
            


       Credit card numbers are sixteen digits in length and employ a check digit scheme developed by IBM. This scheme is also used by credit card companies, libraries, blood banks, photo-finishing companies, pharmacies, some motor vehicle divisions, and some German banks. What makes it so powerful is that it can be used with identification numbers of any length.

The IBM Check Digit Scheme

Let a1a2a3...an-1 be an identifying number. The check digit an is appended to the number a1a2a3...an-1 to create the identification number a1a2a3...an-1an by using the permutation s = (0)(1,2,4,8,7,5)(3,6)(9) in one of the following two ways.

i) If n is even, the check digit an is assigned such that

s (a1)+a2+s (a3)+a4+...+s (an-1)+an = 0 (mod 10)

ii) If n is odd, the check digit an is assigned such that

a1+s (a2)+a3+s (a4)+...+ s (an-1)+an = 0 (mod 10)

     The IBM scheme catches all single digit errors. It catches all transposition of adjacent digit errors, except those that involve 0 and 9.

Examples:

    A valid (yet made-up) credit card number: 1076 2112 8317 2708

           s (a1)+a2+s (a3)+a4+...+s (a15)+a16 (mod 10)

= s (1)+0+s (7)+6+s (2)+1+s (1)+2+s (8)+3+s (1)+7+s (2)+7+s (0)+8 (mod 10)

= 2 + 0 + 5 + 6 + 4 + 1 + 2 + 2 + 7 + 3 + 2 + 7 + 4 + 7 + 0 + 8 (mod 10)

= 60 (mod 10)

= 0

   Since the result of the calculation is 0, the number is valid.

   An invalid credit card number: 3011 8231 2176 8115

s (a1)+a2+s (a3)+a4+...+s (a15)+a16 (mod 10)

= s (3)+0+s (1)+1+s (8)+2+s (3)+1+s (2)+1+s (7)+6+s (8)+1+s (1)+5 (mod 10)

= 6 + 0 + 2 + 1 + 7 + 2 + 6 + 1 + 4 + 1 + 5 + 6 + 7 + 1 + 2 + 5 (mod 10)

= 56 (mod 10)

= 6

Since the result of the calculation is not 0, the number is invalid.