For a prime $p$ find integers $n,m$ s.t $ p > n>m>0$ and $n^3 \equiv m^3 \pmod p$ Sitting at home on daddy leave i have decided to try to learn more number theory. I was playing around with some equations and got to this, which i don't know how to proceed with:
"
For a prime $p$, how to find (if there is) the smallest integers $p > n > m > 0$ such that 
$n^3 \equiv m^3 \pmod p$"
 A: $$n^3\equiv m^3\pmod p\implies p|(n^3-m^3)=(n-m)(n^2+mn+m^2)$$
Since $p$ is prime, $p|(n-m)$ or $p|(n^2+mn+m^2)$ but $n\ne m$ and $0<m<n<p$ so we can see $p\not\mid(n-m)$.  
Now I'm just going to kind of pull something out of a hat and say that $m^2+mn+n^2$ is the norm on the Euclidean domain $\Bbb Z[\omega]$ where $\omega=e^{2\pi i/3}$, also known as the Eisenstein integers, which are numbers of the form $m+n\omega$ where $m,n\in \Bbb Z$.
The norm of $a+b\omega$ is actually defined as $(a+b\omega)(a+b\overline \omega)=a^2-ab+b^2$.  The norm is multiplicative (you can check this yourself!), which means $N(\alpha)N(\beta)=N(\alpha\beta)$ for all $\alpha,\beta\in\Bbb Z[\omega]$.
Okay, so now we have $$m^2+mn+n^2=(m-n\omega)(m-n\overline\omega)=(m-n\omega)(m+n-n\omega)$$
And we want $p|(m-n\omega)(m+n-n\omega)$.  Question: is $p$ prime in $\Bbb Z[\omega]$?  A: it depends.
Note that if $p$ is not prime on the Eisensteins, there exist $\alpha,\beta\in \Bbb Z[\omega]$ such that $N(\alpha),N(\beta)\ne 1$ (i.e. $\alpha$ and $\beta$ are not units) and $\alpha\beta=p$.  Thus $N(\alpha)N(\beta)=p^2$ and since $p$ is prime we can conclude that $N(\alpha)=N(\beta)=p$ (note that, upon inspection, this also implies they are conjugate).  Thus we need to find some $a,b$ such that $a^2-ab+b^2=p$.  Consider $\mod 3$:
$$ \begin{align} (-1)^2-(-1)(-1)+(-1)^2&\equiv 1\pmod3\\
(-1)^2-(-1)0+0^2&\equiv 1\pmod 3\\
(-1)^2-(-1)1+1^2&\equiv 0\pmod 3\\
0^2-0\cdot 0+0^2&\equiv 0\pmod 3\\
0^2-0\cdot1+1^2&\equiv 1\pmod 3\\
1^2-1\cdot 1+1^2&\equiv 1\pmod 3 \end{align} $$
So we see if $p\equiv 2\pmod 3$  then $p$ is prime in the Eisensteins.
By quadratic reciprocity, $\left(\frac{3}{p}\right)\left(\frac{p}{3}\right)=(-1)^{\frac{p-1}{2}\frac{3-1}{2}}$.  If $p\equiv 1\pmod 3$, 
$$\begin{align}\left(\frac{3}{p}\right)&=(-1)^{(p-1)/2}\\
\left(\frac{-1}{p}\right)\left(\frac{3}{p}\right)&=(-1)^{(p-1)/2}(-1)^{(p-1)/2}\\
\left(\frac{-3}{p}\right)&=(-1)^{p-1}=1\end{align}$$
So there exists $k$ such that $k^2+3\equiv 0\pmod p$.  Now let $$\mathcal L=\{(a,b)\in \Bbb Z^2\mid a\equiv \ell b\pmod p\}=\{\lambda (\ell,1)+\mu (0,p)\mid \lambda,\mu\in\Bbb Z\}$$
Where $\ell\equiv\frac{d-1}{2}\pmod p$ (note $\ell^3\equiv 1$). By Minkowski's Theorem, there is at least one lattice point in the region $\{(a,b)\in\Bbb Z^2\mid a^2+ab+b^2<(2p)^2\}$.  Since $a^2+ab+b^2\equiv b^2(z^2+z+1)\equiv b^2 \frac{z^3-1}{z-1}\equiv 0\pmod p$, we can deduce that $a^2+ab+b^2=p$.  Thus given a prime $p\in\Bbb N$, $p$ is an Eisenstein prime if and only if $p\equiv 2\pmod 3$.
If $p$ is an Eisenstein prime, then $p|(m-n\omega)(m+n-n\omega)\implies p|(m-n\omega)\lor p|(m+n-n\omega)$.  Since $p$ is real, $p$ must divide the real and imaginary parts separately, so we find $p|n$, which contradicts the supposition that $0<n<p$.
If $p\equiv 1\pmod 3$, the above proof illustrates that we can actually find a lattice of points $m,n$ such that $p|(m^2+mn+n^2)\implies m^3\equiv n^3\pmod p$, generated by the vectors $\begin{pmatrix}\frac{\sqrt{-3}-1}{2}\\1\end{pmatrix}$ and $\begin{pmatrix}0\\p\end{pmatrix}$.
A: When you are looking for a solution for $m$ and $n$, it is not immediately clear what you mean by the smallest solution (smallest $m$?, smallest $n$?, smallest sum?), but here is a partial solution:
Either by looking at cubic reciprocity, or by examining the possibilities arising from $k^{p-1}\equiv 1 \pmod{p}$, we see that there are essentially 2 cases:
1) $\quad p=3$, or $p \equiv 2 \pmod 3$. This case is trivial, since all the residues $0^3, 1^3, 2^3, \dots (p-1)^3$ are distinct, so there are no solutions of the equation  $n^3 \equiv m^3 \pmod p$, satisfying your conditions.
2) $\quad p\equiv 1 \pmod{3}$. In this case exactly one third of the residues are cubes mod 3, and in particular, $1$ is a cubic residue which has three cube roots in $\{0, 1, 2, \dots, p-1 \}$, so there will always be a solution with $m=1$, and $2 \le n \le p-2$, but I do not know of any easy way to find the smallest such $n$.
A: $n^3 = m^3$ iff $(n/m)^3 = 1$.  Now $x^3 - 1 = (x-1)(x^2+x+1)$ and we want $x \ne 1$, so we want to solve 
$x^2+x+1=0$.  $p=2$ is not very interesting here; otherwise $x = -1/2 \pm \sqrt{-3}/2$.
So there will be solutions mod the odd prime $p$ iff $-3$ is a square mod $p$.  By quadratic reciprocity that is equivalent to $p \equiv 0 \text{ or } 1 \mod 3$.  
EDIT: Actually $p=3$ is not good either because the solution of $x^2+x+1=0$ would be $1$.
