In: Computer Science
Given the number: 7992739874
What would the check-digit be after applying luhns algorithm and how would we find it?
--> Given number is 7992739874
--> Now take every second digit of the number and replace it with 2 times original number:
ex: Take second digit 9
2*9 = 18
Since It have 2 digits add them up to get a single digit 1+8 = 9
--> So, the number becomes
7 9 9 2 7 3 9 8 7 4
18 4 6 16 8
9 4 6 7 8
7 9 9 4 7 6 9 7 7 8
--> Now take the sum of those digits
7 + 9 + 9 + 4 + 7 + 6 + 9 + 7 + 7 + 8 = 73
--> So, the check-sum is 73, mod 10 will give 3
--> Since it is not 0, the number is not valid.