tags:

views:

99

answers:

2

hi all,

how can we find the last 10 digits of a number like a*(2^b) + 1 when a,b are prime numbers...

+3  A: 

Use modular arithmetic, and modular exponentiation in base 10^10

Michael Anderson
+1  A: 

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.

EJP