# Thread: n^3 mod 6 = n mod 6

1. ## n^3 mod 6 = n mod 6

Hi,

I have a problem that I haven't quite been able to solve.

Prove for any n, n^3 mod 6 = n mod 6

I know that a mod n = b mod n iff n|(a-b) but I can't quite get there.

This is as far as I have gotten:

Rewrite n^3 mod 6 = n^3 = 6q + r and n mod 6 = n = 6t + s for some integers q, t, s, r where r >= s.

Then subtract both equations so:

n^3 - n = (6q +r) - (6t +s) = 6(q-t) + (r-s)

If r = s then r-s = 0 and 6|(n^3 -n)

After that point I get stuck. Is this the right way to prove this or am I making it too complicated?

Any help would be appreciated. Thanks.

2. Originally Posted by mali916
Hi,

I have a problem that I haven't quite been able to solve.

Prove for any n, n^3 mod 6 = n mod 6

I know that a mod n = b mod n iff n|(a-b) but I can't quite get there.

This is as far as I have gotten:

Rewrite n^3 mod 6 = n^3 = 6q + r and n mod 6 = n = 6t + s for some integers q, t, s, r where r >= s.

Then subtract both equations so:

n^3 - n = (6q +r) - (6t +s) = 6(q-t) + (r-s)

If r = s then r-s = 0 and 6|(n^3 -n)

After that point I get stuck. Is this the right way to prove this or am I making it too complicated?

Any help would be appreciated. Thanks.
Since there are only six residue classes mod six, why not just check that it's true for those?

$\displaystyle 0^3\equiv 0\text{ mod }6$

$\displaystyle 1^3\equiv 1\text{ mod }6$

$\displaystyle 2^3=8\equiv 2\text{ mod }6$

$\displaystyle 3^3=27\equiv 3\text{ mod }6$

$\displaystyle 4^3\equiv\left(-2\right)^3=-8\equiv -2\equiv 4\text{ mod }6$

$\displaystyle 5^3\equiv \left(-1\right)^3=-1\equiv 5\text{ mod }6$

...done.