Find the last $3$ digits of $3^{352}$ ?
Apart from Carmichael Function, any other way of solving it ?
Find the last $3$ digits of $3^{352}$ ?
Apart from Carmichael Function, any other way of solving it ?
Note that $3^4=81$, so $$\begin{aligned}3^{352} &\equiv (80+1)^{88} \pmod{1000} \\ &\equiv 1+\binom{88}{1} 80 + \binom{88}{2} 6400\pmod{1000} \\&\equiv 1+040+200 \pmod{1000} \end{aligned} $$
Because last two digits of $88\times 8$ is $04$, while last digit of $44\times 87\times 64$ is $2$.
Note that we can achieve the result with a simple desk calculator with limited capacity just by dichotomy on the exponent.
$352=11\times2^5$
So we first calculate $3^{11}=81\times 81\times 27=177147\equiv 147\pmod{1000}$
Then we successively square five times the result modulo $1000$.
$147^2=21609\to 609^2=370881\to 881^2=776161\to 161^2=25921\to 921^2=848241$
And the final result is $241$.
It required only $7$ multiplications, compared to the $3$ in the smart method by pisco125. So it is not a big overhead.
Here is an elementary method (there may be more clever ones):
Notice
$3^{352} = 3^{(11 \cdot 2^5)} = 177147^{(2^5)} = (t + 147)^{(2^5)}$
where $t$ stands for "thousands"
Now as you are only interested in the last 3 digits, you are not interested in any multiples of $t$. With that understanding, we have five times the quadratic equation:
$(t_1 + 147)^2 = t_2' + 147^2 = t_2' + 21609 = t_2 + 609$
$(t_2 + 609)^2 = t_3' + 609^2 = t_3' + 370881 = t_3 + 881$
$(t_3 + 881)^2 = t_4' + 881^2 = t_4' + 776161 = t_4 + 161$
$(t_4 + 161)^2 = t_5' + 161^2 = t_5' + 25921 = t_5+ 921$
$3^{352} = (t_5 + 921)^2 = t_6' + 921^2 = t_6' + 848241 = t_6 + 241$
So the last three digits are 241.
As you imply, the Carmichael function $\lambda(1000) = \text{lcm}(\,\lambda(5^3), \lambda(2^3)\,) = \text{lcm}(100,2) = 100$ is the least universal exponent.
All$\bmod 1000$, this gives us that $3^{352}\equiv 3^{52}$ and then:
$\begin{align}3^{52} = 9^{26} = (10-1)^{26}
& \equiv (-1)^{26} + 26\cdot 10\cdot (-1)^{25} + \overbrace{\frac{26\cdot25}2}^{\text{odd mult of 5}}\cdot 10^2\cdot (-1)^{24}\\
& \equiv 1-260+500 \equiv 241\\
\end{align}$
One has $3^4 \equiv 1$ (mod 8) so $3^{352} \equiv 1$ (mod 8).
Moreover, $3^{50} \equiv -1$ (mod 125) so $3^{352} \equiv (-1)3^{2} = -9$ (mod 125).
So $3^{352} - 241 \equiv 0$ (mod 125) and (mod 8). So $3^{352} \equiv 241$ (mod 1000).
Take $3^{352}\equiv x\pmod{10}$.
Which is equivalent to
$\begin{align}({3^{4}})^{88}&\equiv x\pmod{10}\\81^{88}&\equiv x\pmod{10}\\1^{88}&\equiv x\pmod{10}\\\end{align}$
Therefore, $x\equiv1\pmod{10}$. Since the last digit of any $n$ is $n\pmod{10}$, so the last digit of $3^{352}$ is $1$.