-1

Prove that if n is an odd positive integer , then $n^2\equiv1\mod8$.

Can I prove by counter example by inserting several odd numbers?

My work: I insert 1 into n. $8\mid(1^2 - 1) \implies 8\mid0$
I insert 3 into n. $8\mid(3^2 - 1) \implies 8\mid8$

Hawk
  • 6,540
Nicholas
  • 559
  • 1
    If a counterexample existed, you could disprove this statement. There is no such counterexample as the statement is true. – John Habert Mar 14 '14 at 19:29
  • You have to check each of the four odd congruency classes modulo $8$: $1, 3, 5$ and $7$. $5$ and $7$ follows from $1$ and $3$ with a small trick, but for this small size it's hardly worth it. Another way of doing it would be to write $(2n + 1)^2 = 4n^2 + 4n + 1$ and argue that $4n^2 + 4n$ always divides $8$. – Arthur Mar 14 '14 at 19:29
  • Sorry not counter examples...I mean just show by examples like I have above or do I need to use congruence classes? – Nicholas Mar 14 '14 at 19:31
  • "Proof by counterexample" is when you're trying to show it's false. It's not sufficient to just consider the first few cases: You have to prove it for all $n$, and there are infinitely many of them. –  Mar 14 '14 at 19:33
  • @Nicholas You can never prove that something is true for "every odd number" by testing odd number by odd number (the same for "every natural number", "every square number", "every real number" or anything else that involves more than finitely many). There are too many of them. Congruency classes will do the trick here since there are only four of them, but as I mention in my previous comment, it can be done without them. – Arthur Mar 14 '14 at 19:34
  • True, it would be a long solution if I have to prove all of the numbers. – Nicholas Mar 14 '14 at 19:34
  • 1
    @Nicholas Not long but I guess, infinite! – Hawk Mar 14 '14 at 19:37

5 Answers5

8

Check it out yourself:

Any odd positive integer can be written as $n=2k+1$

$n^2=4k^2+4k+1=4k(k+1)+1$

Now, for two consecutive integers, there exists one integer which is even.

I think you are done.

Hawk
  • 6,540
  • Is the work suppose to be done after 4k(k+1)+1? Do I need to say 4k would always be even and k+1 can be odd or even? – Nicholas Mar 14 '14 at 19:40
  • @Nicholas Absolutely not, $4k$ and $4(k+1)$ are both even, but observe that among two consecutive integers, there has to be one divisible by 2, so we can prove that $4k(k+1)$ is divisible by $8$. – Hawk Mar 14 '14 at 19:42
  • @Nicholas If you still have any doubt, you can ask me, I will try to clarify them. – Hawk Mar 14 '14 at 19:45
  • Ah yes you are 4(k+1) is even, my apologies. – Nicholas Mar 14 '14 at 19:46
  • I need clarification on this part: I am suppose to prove 8 divides n^2 - 1 and n^2 - 1 is actually 4k(k+1). So I need to prove 8 divides 4k(k+1)? Do I need to say 4k and 4k(k+1) is even as part of the answer, would that help me in any way to support the proof? – Nicholas Mar 14 '14 at 19:48
  • No, all you need to say is that $k$ and $k+1$ are two consecutive positive integers. So, clearly one of them is divisible by $2$, i.e., one of them is even. Now, $4(k(k+1))$ is most certainly divisible by $4$. And, from $k(k+1)$ you can get one more $2$. So, from $4\times 2=8$ you are done. – Hawk Mar 14 '14 at 19:53
  • You get one more 2 only if k is 1. So I need to assume k is 1 and k+ 1 is 2, then? – Nicholas Mar 14 '14 at 20:01
  • @Nicholas Why? Take any other k. You can still extract a 2 even then. – Hawk Mar 14 '14 at 20:05
3

$n$ odd $\Rightarrow\, n = 4k\pm1\,\Rightarrow\,n^2\! = 8(2k^2\pm k)+1$

Bill Dubuque
  • 272,048
2

If $n$ is an odd positive integer, then $n = 2k+1$, for some integer $k \geq 0$.

$$(2k+1)^2 = 4k^2 + 4k + 1 = 4k(k+ 1) + 1.$$

Clearly, $4\mid 4k(k+1)$. Now, one of the factors in $k(k+1)$ is even. So $2\mid k(k+1)$.

That gives us $(2\times 4)\mid 4k(k+1)$. So $$4k(k+1)\equiv 0 \mod 8 \iff 4k(k+1) + 1\equiv 1 \mod 8$$

amWhy
  • 209,954
1

You can do the test only on a finite set of numbers, provided you use the right set and say why it is sufficient. Trying $1$ and $3$ is not sufficient, unless you justify why.

You can always write $n=8k+r$, for some $r$ with $0\le r<8$; of course, if $n$ is odd, also $r$ is odd. Since $$ n^2=(8k+r)^2=64k^2+16kr+r^2 $$ you need to show the thesis only for $1$, $3$, $5$ and $7$: $$ 1^1=1,\quad 3^2=9\equiv 1\pmod{8},\quad 5^2=24\equiv 1\pmod{8},\quad 7^2=49\equiv 1\pmod{8} $$ so the thesis is proved.

If you consider that $5\equiv -3\pmod{8}$ and $7\equiv -1\pmod{8}$, then you can see that your test actually suffices (thanks to Lucian for suggesting the idea), but without a motivation for the sufficiency your proof would be invalid.

egreg
  • 238,574
  • It gets even simpler when one considers $5\equiv-3\mod8$ and $7\equiv-1\mod8$. – Lucian Mar 14 '14 at 21:15
  • @Lucian Yes, of course. But I wanted to show how to do the verification with a test on numbers. All those that are needed, not just two as in the question. – egreg Mar 14 '14 at 21:17
0

For every odd number $n,$ the integer $n^2-1=(n-1)(n+1)$ is the product of two consecutive even numbers, hence it is a multiple of $4\cdot2=8.$

Anne Bauval
  • 34,650