What is the smallest natural number n? What is the smallest natural number n for which there is a natural k, such that, the lasts 2012 digit in the representation decimal of $n^k$ are equal to 1?
I don't even know how to start with it ...
 A: Using a quick search with my computer, here’s what I found so far :
Looking only at the last digit, some power of $n$ must be congruent
to $1$ modulo $10$, so $n$ must be congruent to $1,3,7$ or $9$ modulo
$10$.
Looking at the  last two digits, some power of $n$ must be congruent
to $11$ modulo $100$, so $n$ must be congruent to $11,31,71$ or $91$ modulo
$100$.
Looking at the last three digits, ome power of $n$ must be congruent
to $111$ modulo $1000$, so $n$ must be congruent to one of $31, 71, 111, 191, 231, 271, 311, 391, 431, 471, 511, 591, 631, 671, 711,
 791, 831, 871, 911, 991$ modulo $1000$.
Looking at the last four digits, ome power of $n$ must be congruent
to $1111$ modulo $10000$, so $n$ must be congruent to one of $71, 1031, 2071, 3031, 4071, 5031, 6071, 7031, 8071, 9031$ modulo $10000$.
Do you see the pattern in those sequences ?
A: $n^k\equiv-1\bmod4$ so $k$ and $n$ are odd.
If n ends in 2012 zeroes we have $n^k\equiv\frac{-1}{9}\bmod10^{2012}$  such a $k$ exists if and only if there is a $t$ such that $n^t\equiv-9\bmod10^{2012}$.
$n^t\equiv1\bmod5,n^t\equiv7\bmod16$ .Since $\lambda(5),\lambda(16)=4$ we have $t=1$ or $3$ ($t$ is odd). Check this is only possible for $n\equiv7\bmod16$ and $n\equiv1\bmod5$ in other words $n\equiv71\bmod 80$.
Now we prove $n=71$ does the trick.
Check $2^{c+3}||71^{2^{c}}-1$ by lte. So $71^{2^{c}}\equiv {2^{c+2}}\bmod2^{y+1}$
Likewise $71^{5^c}\equiv 5^{c+1}+1\bmod5^{c+2}$
If there is a $w$ such that $2^w\equiv-9\bmod a^c$but $2^w\neq-9\bmod2^{c+1}$ then $2^w\equiv2^c-9$ which implies $2^{w+2^{c-2}}\equiv{-9}\bmod2^{c+1}$ so there is also a solution for $2^c+1$.
Likewise if there is $w$ so $5^w\equiv-9\bmod5^c$ then $ 71^w\equiv a5^c-9\pmod{5^{c+1}} $ for some a not divisible by 5. Then if $5|mb+a$ we have $ 71^{w+m5^{c-1}}\equiv(a5^c-9)(b5^c+1)^m\equiv(mb+a)5^c-9\equiv-9\pmod{5^{c+1}}$.
Now let $c=2012$. By the above there are $w_1$ and $w_2$ such that $71^{w_1}\equiv-9\bmod2^{2012}$ and $71^{w_2}\equiv -9 \bmod 5^{2012}$
By chinese remainder theorem there is a $w$ such that 
$w\equiv w_1\bmod2^{c-3}$ and $w\equiv w_2 \bmod 5^{c-1}$
so $71^w\equiv -9\bmod10^c$ as desired. 
