Sometimes it is useful to be able to tell if a credit card number is valid or no
ID: 3858899 • Letter: S
Question
Sometimes it is useful to be able to tell if a credit card number is valid or not.mFor each of the following credit card numbers, perform the Luhn check algorithm to get the sum (see the clip on Blackboard), indicate if the credit card number is valid and if it is not,what would the valid credit card number be? Remember that if the credit cardnumber is invalid, you are only changing the last digit of the original number. Please show your work.
a. 4550 2081 6375 1768
b. 5491 3865 6189 8631
c.4611 1153 6729 8795
d.1234 5678 9098 7654
Explanation / Answer
steps of luhn check algorithm
a 4550208163751768
60%10==0 so it is a valid number now.
--------------------------------------------------------------------------------------------------------------------------
b 5491 3865 6189 8631
Reverse the digits: 1368981656831945
sum of odd digit : 1+6+9+1+5+8+1+4 =35 =X
The even digits: 3,8,8,6,6,3,9,5
Two times each even digit: 9,16,16,12,12,9,18,10
Sum the digits of each multiplication: 9+7+7+3+3+9+9+1 =48 =Y
X+Y = 83 which is not a valid number so if we change the last digit of original number to 8 we get X = 42 and X+Y = 90 which ends in zero which means that 5491 3865 6189 8638 is a valid number
-----------------------------------------------------------------------------------------------------------
c 46111115367298795
reverse of number : 5978927635111164
sum of odd digit X = 39
X+Y = 75 which is not a valid number to make it a valid number we have to change the last digit of orginal number to 0 which gives X = 34 and then we get X+Y = 70 which ends in 0 and passes the luhn test.
---------------------------------------------------------------------------------------------
d 1234567890987654
reverse of number : 4567890987654321
sum of odd digit X= 38
X+Y = 76 which is not a valid number
to make it valid we change the last digit of original number to 8 which gives X = 42 and we get X+Y = 80 which ends in 0 which means that it passes the luhn test.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.