Show that an integer matrix with following conditions is the identity $I$ 
*

*every entries of $A$ is integer

*every entries of $A-I$ is multiple of a prime $p$ ($p\geq3$)

*there exists $n\ge1$ such that $A^n=I$


show that $A=I$
I tried $A=I+p^kB$ where not every entries of $B$ is multiple of $p$.
then $(I+p^kB)^n=I+np^kB+{n(n-1)\over2}p^{2k}B^2+...+p^{nk}B^n $
but how should I proceed?
thanks in advance
 A: Replacing $A$ by $A^d$ for a maximal proper divisor $d$ of $n$, it suffices to prove the statement in case $n$ is a prime number.
Let us prove that $n\neq p$. By contradiction. Suppose that $n=p$. Write $A=I+p^kB$ with $B\not\equiv0\pmod p$. Then
$$
I=A^p=(I+p^kB)^p=\sum_{i=0}^p\binom{p}{i}p^{ik}B^i
$$
which we want to reduce modulo $p^{k+2}$. Note that  the binomial coefficients $\binom{p}{i}$ are divisible by $p$ for $i=1,\ldots,p-1$. Hence
$$
p^{k+2}|\binom{p}{i}p^{ik}
$$
for $i=2,\ldots,p$ since $k\geq1$ and $p\geq3$. It follows that
$$
I\equiv I+p^{k+1}B\pmod{p^{k+2}},
$$
fron which it follows that $B\equiv0\pmod p$. Contradiction.
Therefore, we have $n\neq p$.
Since $A^n=I$, one has $(A-I)(A^{n-1}+\cdots+I)=0$. Since $A\equiv I\pmod p$, one has $A^{n-1}+\cdots+I\equiv nI\bmod p$ is invertible as a matrix with coefficients in $\mathbf F_p$. It follows that $A^{n-1}+\cdots+I$ has a nonzero determinant in $\mathbf Z$. Hence $A-I=0$, that is $A=I$.
A: We will show that $np^kB+\dots +p^{nk}B^n=0$ implies that $n=0$. To do this, assume that $n=p^lm$, where $(m, p)=1$. Then we have $mB+\dots +p^{nk-l-k}B^n=0$. We want to show that we must have every coefficient other than $m$ is a $p$-divisible integer, and then working mod $p$, we obtain a contradiction. To do this, we must show that $\binom{n}{j}p^{j-l-2}$ is an integer for $j>1$. We are studying the coefficents of $(1+px)^{p^lm}=((1+px)^{p^l})^{m}$, and an easy aurguement shows that we may reduce to $m=1$. But letting $v_p(n)$ be the maximal power of $p$ dividing $n$, we have $v_p(\binom{p^l}{j})=l-v_p(j)\ge l-j+2$, since $p>2$ and $j>1$. This is an application of Kummer's Theorem. Thus all the coefficents of the original equation vanish mod $p^{l+1}$, except the first, and we are done.
