[Math] How to calculate $a^b$ (mod 10, 100 etc. ), where $a$ is not co-prime to $10$.

number theory

I am trying to learn to find out the last digits for an arbitrary power ($b$) of arbitrary number ($a$) i.e. of $a^b$ where $a$ and $b$ both are natural numbers.

For last digit we shall solve $a^b \equiv x$ (mod $10$). For last two digits we shall solve $a^b \equiv x$ (mod $100$). For last three digits we shall solve $a^b \equiv x$ (mod $1000$) and so on.

I have considered a counterexample $6^{73}$(mod 10) and (mod $100$). I am facing the following problems.

  1. $6$ is not co-prime to $10$, so we can not use Fermat's or Euler's or Carmichael's formula. So I am taking a system of linear congruence $6^{73} \equiv x$ (mod$5$) and $6^{73} \equiv y$ (mod$2$) and then I want to apply Chinese Remainder Theorem. I am getting $x = 1$ and $y = 0$. Now I do not know how to use Chinese reminder Theorem. Please explain step by step.

  2. $100 = 2^2 \times 5^2$. Can I apply the relations $6^{73} \equiv 1$ (mod$5$) and $6^{73} \equiv 0$ (mod$2$) to find the last two digits? How ? Otherwise I have to solve $6^{73} \equiv x$ (mod$25$) and $6^{73} \equiv y$ (mod$4$), and then the same method will be used.

I am learning a few topics of number theory myself. Please sufficient resources for this problem. Is there any other method for solving such type of problems? Can we find the first digit of this number in this way?

Thank you for your help.

Best Answer

As $(6^{73},10)=2,$ start with $$6^{73-1}\pmod{\frac{10}2}\text{ i.e.,} 6^{72}\pmod5$$

As $\displaystyle6\equiv1\pmod5, 6^r\equiv1$ where integer $r\ge0$(Here $r=72$)

Now use $\displaystyle a\equiv b\pmod m\implies a\cdot c\equiv b\cdot c\pmod{m\cdot c}$ where $a,b,m,c$ are integers

Here $c=6$

Related Question