Cracking ISBN and Credit Card Codes
ISBN codes are used on all books published worldwide. It’s a very powerful and useful code, because it has been designed so that if you enter the wrong ISBN code the computer will immediately know – so that you don’t end up with the wrong book. There is lots of information stored in this number. The first numbers tell you which country published it, the next the identity of the publisher, then the book reference.
Here is how it works:
Look at the 10 digit ISBN number. The first digit is 1 so do 1×1. The second digit is 9 so do 2×9. The third digit is 3 so do 3×3. We do this all the way until 10×3. We then add all the totals together. If we have a proper ISBN number then we can divide this final number by 11. If we have made a mistake we can’t. This is a very important branch of coding called error detection and error correction. We can use it to still interpret codes even if there have been errors made.
If we do this for the barcode above we should get 286. 286/11 = 26 so we have a genuine barcode.
Check whether the following are ISBNs
1) 0-13165332-6
2) 0-1392-4191-4
3) 07-028761-4
Challenge (harder!) :The following ISBN code has a number missing, what is it?
1) 0-13-1?9139-9
Answers in white text at the bottom, highlight to reveal!
Credit cards use a different algorithm – but one based on the same principle – that if someone enters a digit incorrectly the computer can immediately know that this credit card does not exist. This is obviously very important to prevent bank errors. The method is a little more complicated than for the ISBN code and is given below from computing site Hacktrix:
You can download a worksheet for this method here. Try and use this algorithm to validate which of the following 3 numbers are genuine credit cards:
1) 5184 8204 5526 6425
2) 5184 8204 5526 6427
3) 5184 8204 5526 6424
Answers in white text at the bottom, highlight to reveal!
ISBN:
1) Yes
2) Yes
3) No
1) 3 – using x as the missing number we end up with 5x + 7 = 0 mod 11. So 5x = 4 mod 11. When x = 3 this is solved.
Credit Card: The second one is genuine
IB teacher? Please visit my new site http://www.intermathematics.com ! Hundreds of IB worksheets, unit tests, mock exams, treasure hunt activities, paper 3 activities, coursework support and more. Take some time to explore!
Please visit the site shop: http://www.ibmathsresources.com/shop to find lots of great resources to support IB students and teachers – including the brand new May 2025 prediction papers.





Coding & Computer Programing? Computer programing is Coding! As an Inventor, all my life, I find “coding” to be the purest Invention, of All. You must
Invent new methods, formulas & techniques as you Code, to get to the final
Program… It is Problem solving at its finest, as each new line brings another
Eureka Moment. I experienced this first hand, when I wrote a 7,000 line Algorithm, that factored R.S.A.#155, in under 3, minutes, confounding all the
Math experts, who theorized, it would take 1 Man @ 1 Computer, longer than
The Universe, has been in Existence!