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$
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$
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.
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$$
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.
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.$