# Number TheoryIf a³ ≡ b³ (mod n) then a ≡ b (mod n)

#### KOO

##### New member
Let $a, b \in Z$ and $n \in N$ . Is the following necessarily true?
If $a^3 ≡b^3$(mod n) then $a ≡ b$ (mod n)

I know it's false but I can't think of an counterexample.

##### Well-known member
Re: If $a^3 ≡b^3$(mod n) then $a ≡ b$ (mod n)

Let $a, b \in Z$ and $n \in N$ . Is the following necessarily true?
If $a^3 ≡b^3$(mod n) then $a ≡ b$ (mod n)

I know it's false but I can't think of an counterexample.
No

$2^3 = 4^3$ mod 8

#### Opalg

##### MHB Oldtimer
Staff member
It can even happen with a prime modulus: $1^3 = 2^3\pmod7$.

#### mathbalarka

##### Well-known member
MHB Math Helper
Even in non-trivial cases : $4^3 = 10^3\pmod{13}$

#### johng

##### Well-known member
MHB Math Helper
Hi,
Here's an easy result in the positive direction.

If 3 is prime to $$\displaystyle \phi(n)$$ and both a and b are prime to n, then the conclusion does follow.

Example: n=17 or any prime p with 3 not dividing p-1