For a given credit card number: Double the value of every other digit from right to left, beginning with the second to last digit. Add the digits of the results of Step 1 to the remaining digits in the credit card number. If the result mod 10 is equal to 0, the number is valid.