# Is it possible for a number in form $1987^k-1$ to end with 1987 zeros? Also few questions about number theory in general.

My fragile attempt: Note that if $1987^k-1$ ends with 1987 zeros, that means $1987^k$ has last digit 1 (and 1986 "next" ones are zeros). For this to be satisfied, $k$ has to be in form $k=4n$, where $n\in N$. This means out number can be written in form

$$[(1987^n)^2+1][1987^n+1][1987^n-1].$$

This number has to be dividable by $10^{1987}$ if there is such a number that is asked for in question.

Now, I believe that the fact 1987 is a prime is very important here. There are probably some theorems from number theory about primes and their powers. For example, if $p$ is a prime (distinct from 2 if needed), are there any important things about number such as $p^2-1$?

If I'm going at the right direction with this, I'd appreciate a hint. Please don't use too advanced techniques if possible. Thanks.

-
So this is basically direct consequence of Carmichael function (I'm not familiar with Euler function so I looked up this generalization), since $GCF(1987,10^{1987})=1$? –  Lazar Ljubenović Feb 7 '12 at 16:31
Yes, sort of. I'm not sure that one can know that the Carmichael function exists and makes sense without first knowing about the Totient function and Euler's theorem. –  deinst Feb 7 '12 at 16:49
I don't, I just looked it up. This is beyond my level anyway, just wanted to make sure I at least understood general idea behind your comment. –  Lazar Ljubenović Feb 7 '12 at 17:15

The standard approach is to use the fact that if $a$ is divisible neither by $2$ nor by $5$, then $$a^{\varphi(10^n)}\equiv 1\pmod {10^n},$$ where $\varphi$ is the Euler $\varphi$-function.

The approach below is much more low-tech! All we need is some comfort with the Binomial Theorem. Suppose that $b_1$ already ends in $1$ (with our number, that means we let $b_1=(1987)^4$).
What happens when we take the $10$-th power of $b_1$?

Think of it this way. We have $b_1=1+10c_1$ for some integer $c_1$. Take (or imagine taking) the $10$-th power of $1+10c_1$, using the Binomial Theorem.

We get $1+(10)(10c_1)$ plus a bunch of terms that are divisible by at least $100$. So the result $b_2$ has shape $1+100c_2$, for some integer $c_2$. In other words, $b_2$ ends in $01$,

Now take the $10$-th power of $b_2$. We get, by the Binomial Theorem, $1+(10)(100c_2)$ plus a bunch of terms that are divisible by at least $1000$. Call this result $b_3$. Note that $b_3$ ends in $001$. Continue.

To sum up, we start with $(1987)^4$ and raise it to the power $10$ repeatedly. We get the numbers $(1987)^{40}$, $(1987)^{400}$, $(1987)^{4000}$, and so on. They are guaranteed to end in $01$, $001$, $0001$, and so on.

-
Following your instructions, for now I could only prove divisibility by 5 for each modulo of $n$ by $4$. I'm not sure how to proceed and prove more powers of five. –  Lazar Ljubenović Feb 7 '12 at 16:35