I have question about Luhn algorithm. The luhn algorithm (mod 10) for error detection and check sum digits. For example digits like visa, credit card etc.
for example we have digits : Digits 1 2 3 4 5 6 7 8 9 3
Step 1: Multiply the value of alternate digits by 2, starting from the second rightmost digit. example: Digit 1 2 3 4 5 6 7 8 9 3 Multiplier X2 X2 X2 X2 X2
Step2: Add all the individual digits of the above products together with the un-doubled digits from the original. If more 10 so add or subtract with 9. number.
Example:
Digit 1 2 3 4 5 6 7 8 9 3
Multiplier X2 X2 X2 X2 X2
Result 2 2 6 4 10 6 14 8 18 3
1+0 1+4 1+8
Sum 2+ 2+ 6+ 4+ 1+ 6+ 5+ 8+ 9+ 3 = 40
Step 3: If the total modulo 10 is equal to 0, then the number is valid according to the LUHN formula; otherwise it is invalid. example. 40 mod 10 = 0 so valid, if not 0 so not valid.
The question is, why in step 2 using Multiply by 2? what the reason? (with link refrence or papers please). thanks