Remainder Problem for composite numbers I have tried  questions like this by expanding them in a binomial state but this question appears to be different
Find the remainder when $2^{1990}$ is divided by 1990.
It is hard because 1990 is not prime and I have solved prolems only when divisors were primes.
Please help me.
 A: Using Fermat's Little Theorem,
$2^4\equiv1\pmod 5\implies 2^{1990}=2^2\cdot(2^4)^{997}\equiv4\cdot1^{997}\pmod 5\equiv4\ \ \ \ (1)$
$2^{198}\equiv1\pmod {199}\implies 2^{1990}=2^{10}\cdot(2^{198})^{10}\equiv1024\cdot1^{10}\pmod{199}\equiv 29\ \ \ \ (2)$
Clearly, $2^{1990}\equiv0\pmod2\ \ \ \ $
Continuing further, we have $2^{1990}\equiv4\pmod5$. This gives us that $2^{1990}\equiv4\pmod{10}$. Now using the fact that $a\equiv4\pmod{10}$ and $a\equiv{29}\pmod{199}$. Notice that $20*10+(-1)*199=1$ thus ${20*10}\equiv1\pmod{199}$ and $-199\equiv1\pmod{100}$. As we have $a\equiv4\pmod{10}$ and $a\equiv{29}\pmod{199}$, let us assume $a=29*(20\times 10) +4\times (-199)$. We can see that is satisfies these two conditions. Hence, we can proceed.  
Thus $a= 5024 \equiv{1024}\pmod{1990}$.
A: By Fermat $\, 2^{\large 2} \equiv 1\pmod{\! 5},\,\  2^{\large 198}\!\equiv 1\pmod{\!199}\ $ so $\ \color{#c00}{2^{\large 396}\equiv \bf 1}\pmod {5\cdot 199}$
So we have $\ {\rm mod}\,\ \color{#0a0}{5\cdot 199\!:\,\ 2^{\large  1998}}\! \equiv  2^{\large 9+5(396)}\! \equiv  2^{\large 9} (\color{#c00}{2^{\large 396}})^{\large 5}\!\equiv 2^{\large 9}{\color{#c00}{\bf 1}}^{\large 5}\!\equiv \color{#0a0}{2^{\large 9}} $
So $\,\ 2^{\large 1990}\!\bmod 1990\, =\, 2\,(\color{#0a0}{2^{\large 1989}\!\bmod\ 5\cdot 199})\, =\, 2(\color{#0a0}{2^{\large 9}}) = 2^{\large 10} =1024$
We used  $\ ca\bmod cn =\, c\,(a\bmod n)\ $ in the prior line. See here for more on that.
A: The prime factorization of $1990$ is $1990 = 2 \cdot 5 \cdot 199$. So calculate $2^{1990}$ modulo $2,5$, and $199$ and then solve the resulting system of congruences to find $2^{1990}$ modulo $1990$.
