If you’re vaguely geeky then you probably know that there’s some mathematical formula behind the ISBN number on the barcode of a book so that typing errors can be spotted. The same applies to the embossed number across the middle of your credit or debit card.
So, if you’re stuck for something to occupy yourself with for a few minutes, see if the number on a card from your wallet or purse follows the rules. Take the following account number, for example. It’s only valid in test systems so can’t be used for fraudulent purposes (or no more than any other invented number can be).
The Luhn Algorithm, created around 60 years ago by Peter Luhn, is used to generate a checksum value for the account number using some basic maths.
The last digit is the checksum – in this case 7. We win a prize if we end up with this number after doing the maths.
Start from the right and double every second digit. So the 2 becomes 4, the 1 becomes 2, and so on.
If you have a double-digit result, add those digits together. So the 16 becomes 7 and the 10 becomes 1.
Add all the digits together (except the checksum number).
1+4+2+3+6+3+0+0+7+9+2+0+2+0+4 = 43
Multiply that total by 9. The last digit of this new number should be the same as the checksum.
43 x 9 = 387 and the last digit is 7. Success! Cake all round.