hi all,
how can we find the last 10 digits of a number like a*(2^b) + 1 when a,b are prime numbers...
hi all,
how can we find the last 10 digits of a number like a*(2^b) + 1 when a,b are prime numbers...
Use modular arithmetic, and modular exponentiation in base 10^10
What difference does it make what the formula is, or what a and b are? The last 10 digits of any number are just the number modulo 10000000000. Unless you are dealing with overflows, in which case see Michael Anderson's answer.