Formally proving that Luhn’s algorithm detects swapping adjacent digits involves some case analysis, but an example will help illustrate the idea. Imagine we have the sequence 31 in our credit card, ...