A short tutorial here on credit card numbers:
I liked the checksum explanation:
Checksum
The final digit of your credit card number is a check digit, akin to a checksum. The LUHN Formula, known also as a Mod 10 calculation, can be used to validate account numbers. The following steps are required to validate the primary account number.
Step 1: Double the value of alternate digits of the credit card number beginning with the second digit from the right (the first right-hand digit is the check digit).
Step 2: Add the individual digits comprising the products obtained in Step 1 to each of the unaffected digits in the original number.
Step 3: The total obtained in Step 2 must be a number ending in zero (30, 40, 50, etc.) for the account number to be validated.
The LUHN formula was designed to protect against accidental errors, not malicious attacks. Most credit cards and many government identification numbers use the algorithm as a simple method of distinguishing valid numbers from random digits. The LUHN algorithm will detect almost any single-digit error.