Prove that if $q\mid x$ and $q^k\parallel x^p$ then $p\mid k$. Suppose $p\neq q$ are distinct primes, and $x\in\mathbb{Z}$. Suppose further, that $q\mid x$, and that there is an integer $k\in\mathbb{Z}$ such that $q^{k}\mid x^{p}$ and $q^{k+1}\nmid x^{p}$.
Is it always true that $k$ is a multiple of $p$?
Firstly, it is clear that $q^{p}\mid x^{p}$, so that $p\le k$. However from here I cannot conclude anything...
 A: $$\begin{align} q^{\large k}\mid\mid x^{\large p}\ \Rightarrow\, \, \ q^{\large k}\ \color{#c00}n &\,=\, x^{\large p},\,\ \ \color{#c00}{q\nmid n},\,  \ \text{so comparing powers of $\,q$}\\[.2em]
\Rightarrow\  k+ \color{#c00}0 &\,=\, p\  \nu_q(x),\ \ \ {\rm so}\ \ \   p\,\mid\, k &
\end{align}$$
A: Assume that $x$ has some integer $a \ge 0$ factors of $q$. Then
$$x = q^a(d), \; \gcd(q,d) = 1 \tag{1}\label{eq1A}$$
so you then have
$$x^p = q^{ap}(d^p) \tag{2}\label{eq2A}$$
With $q^k \mid x^p$, then $x^p$ has at least $k$ factors of $q$, but since $q^{k+1} \not\mid x^p$, then $x^p$ has less than $k + 1$ factors of $q$. This means $x^p$ has exactly $k$ factors of $q$. Thus, from \eqref{eq2A} you have
$$k = ap \tag{3}\label{eq3A}$$
This shows that $k$ is an integral multiple of $p$.
A: $q$ is prime.  So if $q^k|x^p$ then $q|x^p$ and $q|x$.  
So there is an $m$ so that $q^m|x$ but $q^{m+1}\not \mid x$.  Let $x = x'q^m$ and $q\not \mid x'$.
$x^p = x'^p q^{mp}$ and $q^k|x'^pq^{mp} \implies k \le mp$.  And $q^{k+1}\not \mid x'^pq^{mp} \implies k+1> mp$. 
So $k = mp$.
