I know that if we want the last 10 decimal digits of $$1234^{1234^{1234}}$$ we should compute $1234^{1234^{1234} \bmod\ \phi(10^{10})} \bmod 10^{10}$ to keep the exponent small. And that technically, $1234^{1234^{1234}\ \bmod\ 10^{10}} \bmod 10^{10}$ is incorrect. Yet they are equal. Why?
Why does $1234^{1234^{1234}\ \bmod\ 10^{10}}$ = $1234^{1234^{1234}\ \bmod \ \phi(10^{10})}$
2
$\begingroup$
modular-arithmetic
totient-function
-
0What do you mean by "why"? – 2012-10-26
-
0I mean why are they equal for these particular constants even though the approach, in general, is flawed. Is this an artifact of base 10? Does 1234 have a particular property? Or does this always work for any base and any constant? – 2012-10-26