Algorithm to add two digits to the end of a number to calculate a specific modulus?

Posted by Jim on Stack Overflow See other posts from Stack Overflow or by Jim
Published on 2008-11-10T14:04:54Z Indexed on 2010/05/09 21:08 UTC
Read the original article Hit count: 291

Filed under:
|

So, lets say I have a number 123456. 123456 % 97 = 72. How can I determine what two digits need to be added to the end of 123456 such that the new number % 97 = 1? Note--it must always be two digits.

For example, 12345676 % 97 = 1. In this case, I need to add the digits "76" to the end of the number.

(This is for IBAN number calculation.)

© Stack Overflow or respective owner

Related posts about modulus

Related posts about iban