You are on page 1of 1

DETERMINING ON WHETHER THE CREDIT CARD NUMBER IS VALID OR NOT:

STEPS:

EXAMPLE 1:

1. Beginning with the second-to-the-last digit and reading from right to left, double every other
digit. EXAMPLE: 5234-8213-3410-1496
5 2 3 4 8 2 1 3 3 4 1 0 1 4 9 6
5x2 2 3x2 4 8x2 2 1x2 3 3x2 4 1x2 0 1x2 4 9x2 6
10 2 6 4 16 2 2 3 6 4 2 0 2 4 18 6

2. If ever a digit becomes a two-digit number after its having been doubled, treat that number as
two single digits
10 2 6 4 16 2 2 3 6 4 2 0 2 4 18 6
1 0 2 6 4 1 6 2 2 3 6 4 2 0 2 4 1 8 6

3. Find the sum of the new list of digits. If the final sum is equal to 0 mod 10, te credit card is valid.
=1+0+2+6+4+1+6+2+2+3+6+4+2+0+2+4+1+8+6= 60
=>60 mod 10 ≡0 mod 10. Therefore the credit card is VALID.

EXAMPLE 2:

1. 6011-0123-9541-2713
6 0 1 1 0 1 2 3 9 5 4 1 2 7 1 3
6x2 0 1x2 1 0x2 1 2x2 3 9x2 5 4x2 1 2x2 7 1x2 3
12 0 2 1 0 1 4 3 18 5 8 1 4 7 2 3

2.
12 0 2 1 0 1 4 3 18 5 8 1 4 7 2 3
1 2 0 2 1 0 1 4 3 1 8 5 8 1 4 7 2 3

3. =1+2+0+2+1+0+1+4+3+1+8+5+8+1+4+7+2+3=53
=>53 mod 10 ≡3 mod 10. Therefore the credit card is NOT VALID.

You might also like