2

Problem:

Show that for every integer $n$, $n^3 - n$ is divisible by 3 using modular arithmetic

I was also given a hint:

$$n \equiv 0 \pmod3\\n \equiv 1 \pmod3\\n \equiv 2 \pmod3$$

But I'm still not sure how that relates to the question.

Jdinh98
  • 43
  • Welcome to math.SE. Could you show us what you've tried so far? – Jay Zha May 22 '17 at 21:50
  • I'm new to the modulo arithmetic concept so I'm not too sure where to start. I know how to solve this using induction but I don' think that will help. – Jdinh98 May 22 '17 at 21:52
  • cool, yep, such comment is sufficient :) – Jay Zha May 22 '17 at 21:52
  • If you consider $n\equiv 0\pmod{3}$ then $n^3\equiv 0\pmod{3}$ so $n^3-n\equiv 0-0\equiv 0\pmod{3}$ can you consider the other two cases similarly? – kingW3 May 22 '17 at 21:58
  • Oh so you basically sub in the other two cases? – Jdinh98 May 22 '17 at 22:00
  • I'm surprised at the length and complexity of some of the posted answers. All you need to do is show that $$ \begin{align} 0^3 & \equiv 0 \pmod 3 \ 1^3 & \equiv 1 \pmod 3 \ 2^3 & \equiv 2 \pmod 3 \end{align} $$ – Michael Hardy May 22 '17 at 23:10
  • For someone new to modular arithmetic, you can equivalently show that $0^3-0 = 3k, 1^3-1=3m, 2^3-2=3n$ for integers $k,m,n$. – Χpẘ May 22 '17 at 23:15

5 Answers5

1

Note that $n^{3} - n = n(n^2 - 1) = n(n+1)(n-1)$. Now treat three cases: $n$ is either congruent to $0,1$, or $2$ mod $3$.

pwerth
  • 3,890
1

First, factor $n^3 -n$

$$n^3-n = n(n-1)(n+1)$$

From here, we have shown that $n^3-n$ is the product of three consecutive integers. In any one set of three consecutive integers, there is one factor of $3$ because one of the numbers is congruent to $0$, another to $1$, and the last to $2 \bmod 3$

Alternatively, we can start from the back and go casewise:

Case 1:$$ n\equiv 0 \mod 3$$

$$n^3 - n \equiv 0^3 - 0 \equiv 0 \mod 3$$

Case 2:

$$n \equiv 1 \mod 3$$

$$n^3 -n \equiv 1^3 - 1 \equiv 1-1 \equiv 0\mod 3$$

Case 3:

$$n \equiv 2 \mod3$$ $$2^3 - 2 \equiv 8-2 \equiv 6 \equiv 0\mod 3$$

Since these cases are exhaustive, we are done.

John Lou
  • 2,436
1

The hint is telling you that you have only three cases to check. Here are the details for this first two cases, I leave the third case for you to finish off:

  1. If $n \equiv 0\pmod 3$, then $n^3 - n \equiv 0^3 - 0 \equiv 0 \pmod 3$
  2. If $n \equiv 1\pmod 3$, then $n^3 - n \equiv 1^3 - 1 \equiv 0 \pmod 3$
  3. If $n \equiv 2\pmod 3$, then $n^3 - n \equiv 2^3 - 2 \equiv \ldots$

The fact that you are using here is that reduction modulo $n$ is a homomorphism, i.e., it respects addition and multiplication.

Rob Arthan
  • 51,538
  • 4
  • 53
  • 105
0

Using the hint is to try the three cases:

Case 1: $n \equiv 0 \mod 3$

Remember if $a \equiv b \mod n$ then $a^m \equiv b^m \mod n$ [$*$]

So $n^3 \equiv 0^3 \equiv 0 \mod 3$

Remember if $a \equiv c \mod n$ and $b \equiv d \mod n$ then $a+b \equiv c + d \mod n$ [$**$]

So $n^3 - n\equiv 0 - 0 \equiv 0 \mod n$.

Case 2: $n \equiv 1 \mod 3$

Then $n^3 \equiv 1^3 \mod 3$ and $n^3 - n \equiv 1^3 - 1 \equiv 0 \mod n$.

Case 3: $n \equiv 2 \mod 3$

Then $n^3 \equiv 2^3 \equiv 8 \equiv 2 \mod 3$.

So $n^3 - n \equiv 2- 2 \equiv 0 \mod 3$.

So in either of these three cases (and there are no other possible cases [$***$]) we have $n^3 - n \equiv 0 \mod 3$.

That means $3\mid n^3 - n$ (because $n^3 - n \equiv 0 \mod 3$ means there is an intger $k$ so that $n^3 - n = 3k + 0 = 3k$.)


I find that if I am new to modulo notation and I haven't developed the "faith" I like to write it out in terms I do have "faith":

Let $n = 3k + r$ where $r = 0, 1$ or $2$

Then $n^3 - n = (3k+r)^3 -(3k+r) = r^3 - r + 3M$

where $M = [27k^3 + 27k^2r + 9kr^2 - 3k]/3$ (I don't actually have to figure out what $M$ is... I just have to know that $M$ is some combination of powers of $3k$ and those must be some multiple of $3$. In other words, the $r$s are the only things that aren't a multiple of three, so they are the only terms that matter. )

and $r^3 -r$ is either $0 - 0$ or $1 - 1 = 0$ or $8 - 2 = 6$. So in every event $n^3 - n$ is divisible by $3$.

That really is the exact same thing that the $n^3 - n^2 \equiv 0 \mod 3$ notation means.


[$*$] $a\equiv b \mod n$ means there is an integer $k$ so that $a = kn + b$ so $a^m = (kn + b)^m = b^m + \sum c_ik^in^ib^{m-i} = b^m + n\sum c_ik^{i}n^{i-1} b^{m-i}$. So $a^m \equiv b^m \mod n$.

[$**$] $a\equiv c \mod n$ means $a= kn + c$ and $b\equiv d \mod n$ means $b = jn + d$ for some integers $j,k$. So $a + b = c+ d + n(j+k)$. So $a+b =c + d \mod n$.

[$***$]. For any integer $n$ there are unique integers $q, r$ such that $n = 3q + r ; 0 \le r < 3$. Basically this means "If you divide $n$ by $3$ you will get a quotient $q$ and a remainder $r$; $r$ is either $0,1$ or $2$".

In other words for any integer $n$ then $n \equiv r \mod 3$ where $r$ is either $0,1,$ or $2$. These are the only three cases.


P.S. That is how I interpretted the hint. As other have pointed out, a (arguably) more elegant proof is to note $n^3 - n = (n-1)n(n+1)$ For any value of $n$ one of those three, $n$, $n-1$, or $n+1$ must be divisible by $3$.

This actually proves $n^3 - n$ is divisible by $6$ as one of $n$, $n-1$ or $n+1$ must be divisible by $2$.


There is also induction. As $(n+ 1)^3 - (n+1) = n^3 - n + 3n^2 + 3n$, this is true for $n+1)$ if it is true for $n$. As it is true for $0^3 - 0 = 0$ it is true for all $n$.

fleablood
  • 130,341
  • Further hint : If $n \equiv 2 \mod 3$ then $n \equiv -1 \mod 3$ and sometimes $-1$ is better to use than $2$. If $n = 3k + 2$ then $n = 3(k+1) = 1$. – fleablood May 22 '17 at 22:30
0

For all primes $p \in \mathbb{N}$ it holds $p | n^p -n$ for all $n \in \mathbb{Z}$, since $\bar 1 = \bar n^{p-1}$ in $\mathbb{F}_p$ if $\bar n \neq \bar 0$ (since $\mathbb{F}_p^\times = \mathbb{F}_p\setminus \{0\}$). Therefore $\bar n^p-\bar n = \bar n(\bar n^{p-1} - \bar 1) = \bar 0$ in $\mathbb{F}_p$ for all $n \in \mathbb{Z}$.

psl2Z
  • 5,772
  • Please strive not to post more (dupe) answers to dupes of FAQs. This is enforced site policy, see here. – Bill Dubuque Nov 14 '24 at 22:30
  • @BillDubuque From that enforced site policy: "If you find the answers to the duplicate target to be lacking, please feel free to add a new answer to the older question, rather than answering the newer duplicate." ?? – psl2Z Nov 15 '24 at 10:18
  • Of course using little Fermat has been posted many times before (e.g. here in one of many possible duplicate targets). Further, this method is great overkill, and Fermat is likely unknown at this point given the supplied hint (ditto for finite fields). We already have most all possible answers for common exercises. – Bill Dubuque Nov 15 '24 at 19:31
  • @BillDubuque Well, I came here from the question https://math.stackexchange.com/questions/4998363/how-to-write-a-direct-proof-for-3-mid-n3-n/4998370#4998370 which was marked as a duplicate of this here. So I thought this here was the original post. Some hours ago this here was not marked as duplicate so strictly speaking I was only doing what this enforced site policy says. Further, I think it is not overkill and is short and easy proof. – psl2Z Nov 15 '24 at 21:59
  • This exercise would not have been posed in any context where little Fermat was already known since then it is an utterly trivial special case $,n=3.,$ Please strive not to duplicate answers that have clearly already been posted many tens (if not hundreds) of times on this site. It does take time to process dupes so please be patient during such. – Bill Dubuque Nov 15 '24 at 22:40