3

I am having difficulty finishing this proof. At first, the proof is easy enough. Here's what I have thus far:
Because $5 \nmid n$, we know $\exists q \in \mathbb{Z}$ such that $$n = 5q + r$$ where $0 < r < 4$. Note $r \neq 0$ because if $r = 0$, then $5 \mid n$. Also note that $n^2 = 25q^2 + 10qr + r^2$. Then we have four cases: when $r=1$, $r=2$, $r = 3$, and $r = 4$. This is where I run into difficulty. In each of these cases, we can prove that either $n^2 = 5k + 1$ or $n^2 = 5k - 1$ for some integer $k$, but I cannot see how to prove both for each case. Any ideas?

As a side note on how I went to prove each case, I simply plugged $r$ into the formula $n^2 = 25q^2 + 10qr + r^2$. This results in $n^2 = 25q^2 + 10q + 1$. Continuing, we get $n^2 = 5(5q^2 + 2q) + 1$, and because $5q^2 + 2q$ is still an integer, this is of the form $n^2 = 5k + 1$ for some integer $k$. But I cannot find how to make the 1 a negative to prove both cases.

  • 1
    I think you meant $5k+1$ and $5k-1$, not $3k+1$ and $3k-1$, but anyways, I think the problem is you went from $25q^2+10qr+r^2$ to $25q^2+10qr+1$ (which is valid if $r=1$ but not if $r=2$) – J. W. Tanner Feb 19 '20 at 23:26
  • Oh my bad, I'm working on another problem of the same type involving 3 and I got confused. Thanks! – Jacob James Feb 19 '20 at 23:26
  • @J.W.Tanner, regarding what you suggested. For $r = 2$ I would also plug it into the formula, resulting in $n^2 = 25q^2 + 20q + 4$ which is equivalent to $n^2 = 25q^2 + 20q + 5 - 1$ which in turn implies $n^2 = 5(5q^2 + 4q + 1) - 1$. This satisfies the desired equation, but once again only yields the result with $-1$ and not with $+1$. – Jacob James Feb 19 '20 at 23:34
  • You're going to get $+1$ with $r=1$ and $r=4$ and $-1$ with $r=2$ and $r=3$ – J. W. Tanner Feb 19 '20 at 23:39
  • "For r=2 I would ... but once again only yields the result with −1 and not with +1." Well, that's only one case. $r = 2$. If you plug in the one case $r=2$ you will get the one case that $n^2 \equiv -1$. And if in you plug in the one case $r=1$ you get the one case that $n^2 \equiv +1$. Now plug in the FOUR cases. $r =1$ or $r=2$ or $r=3$ or $r=4$. With $r = 1$ you get $25q + 10qr + 1$ for $r =2$ you get $25q^2 +10qr + 5 -1$ and for $r=3$ you get $25q^2 +10qr + 10 -1$ and for $r=4$ you get $25q^2 + 10qr + 15 + 1$. – fleablood Feb 19 '20 at 23:53
  • Okay.... you seem to think that $5k \pm 1$ means that it equals both $5k +1$ AND $5k-1$ both at the same time! ......It doesn't. Nothing can equal both at the same time. This statement is that for any $n$ then $n^2$ will either be $n^2= 5k+1$ for some $n$s. And $n^2 = 5k -1$ for some $n$s. But not both at the same time for all $n$s. So if $n = 5q +1$ you get $n^2 = 25q^2 + 10q + 1=5k + 1$ when $k=5q^2+2$. And if $n=5q+2$ then $n^2 = 25q^2 + 20q +4=5k -1$ when $k=5q^2+4q+1$ and so on.... – fleablood Feb 20 '20 at 00:01
  • Wow thanks for all of the very quick responses! @fleablood you are absolutely right and I will probably be face-palming for the next 24 hours. Thanks for the help! – Jacob James Feb 20 '20 at 00:03

3 Answers3

4

As you showed, $n^2=25q^2+10qr+r^2$, where $r=1, 2, 3,$ or $4$.

When $r=1$, $n^2=25q^2+10qr+1=5(5q^2+2qr)+1=5k+1.$

When $r=2$, $n^2=25q^2+10qr+4=5(5q^2+2qr+1)-1=5k-1.$

When $r=3$, $n^2=25q^2+10qr+9=5(5q^2+2qr+2)-1=5k-1.$

When $r=4$, $n^2=25q^2+10qr+16=5(5q^3+2qr+3)+1=5k+1.$

(Note: I did not mean to imply that $k$ in one equation is the same as $k$ in another.)

J. W. Tanner
  • 60,406
1

Just do it.

$n^2 = 25q^2 + 10qr + r^2 = 5(5q^2 + 2qr) + r^2$.

ANd $r^2 = 1,4=5-1, 9 =10-1$ or $16=15+1$.

So if $n = 5q + 1$ then $n^2 = 5(5q^2 + 2q) + 1$

If $n=5q+2$ then $n^2 = 5(5q^2 + 4q)+4 = 5(5q^2+4q + 1) -1$

If $n = 5q+3$ then $n^2= 5(5q^2 + 6q) + 9 = 5(5q^2 + 6q + 2) -1$

And if $n = 5q+4$ then $n^2 = 5(q^2 + 8q) + 16=5(5q^2 + 8q + 3) + 1$.

That's it.

fleablood
  • 124,253
1

To keep things concise I have stretched the notation a bit, but I think my meaning is clear:

In the language of congruence,

$5 \not \mid n \Longrightarrow n \not \equiv 0 \mod 5; \tag 1$

then one of the following holds:

$n \equiv 1, 2, 3, 4 \mod 5, \tag 2$

whence

$n^2 \equiv 1, 4, 9, 16 \mod 5 \equiv 1, 4, 4, 1 \mod 5; \tag 3$

but

$4 \equiv -1 \mod 5, \tag 4$

so

$n^2 \equiv \pm 1 \mod 5 \Longrightarrow n^2 \pm 1 \equiv 0 \mod 5$ $\Longrightarrow \exists k \in \Bbb Z, \; n^2 \pm 1 = 5k \Longrightarrow \exists k \in \Bbb Z, \;n^2 = 5k \pm 1. \tag 5$

Robert Lewis
  • 71,180