Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Luhn algorithm (i think you know that ) calculator: If number is in an even, add

ID: 3592856 • Letter: L

Question

Luhn algorithm(i think you know that) calculator:

If number is in an even, add it to the sum.

else If number is an odd, times 2 and add the digits of the resulting product to sum.

If the whole number is valid, the final sum will have an 0 as end.

if number is 6411.

The first digit, 6, times 2, =12, so 1 + 2 = 3, add to sum.

The second digit, 4, add to sum.

The third digit, 1, times 2, =2, so 2 is add to sum.

The fourth digit, 1, times 2, =2, so 2 is add to sum.

So the checksum is 3 + 4 + 2 + 1 = 10. valid.

Explanation / Answer

The Luhn algorithm was developed by German computer scientist Hans Peter Luhn in 1954. It calculates simple checksum formula used to validate identification numbers such as credit card numbers. The algorithm was designed to protect against accidental errors, such as a digit mistyping. It will detect any single-digit error, as well as almost all transpositions of adjacent digits. It will not, however, detect transposition of the two-digit sequence 09 to 90 (or vice versa).
The calculator below gives Luhn checksum of the given digit sequence. The sequence is considered valid if the checksum mod 10 equals to zero. It also gives the next check digit to be appended at the end of source sequence to form valid number according Luhn algorithm.

The first digit, 6, times 2, =12, so 1 + 2 = 3, add to sum.

The second digit, 4, add to sum.

The third digit, 1, times 2, =2, so 2 is add to sum.

The fourth digit, 1, times 2, =2, so 2 is add to sum.

So the checksum is 3 + 4 + 2 + 1 = 10. valid.