2
$\begingroup$

$N$ can be at most $10^{10}$ and $M$ can be at most $10^7$. How can I find the first three digits of $N^M$ ?

Is there an easy way to find this like the process of finding last digit ?

  • 0
    If $N$ and $M$ are so small, you might as well just calculate $N^M$ rather than waste time thinking of a smarter method.2012-11-01
  • 0
    what if they are very large ?2012-11-01

1 Answers 1