"Suppose that n is an odd number. Prove that n^2 is congruent to 1 modulo 8."

I solved by substituting n with 1, 3, 5, and 7 since they are all odd and remainders of mod 8. I concluded that the equation is true because they all are congruent to 1. However I don' t know if that's the correct way to go about it or if I need to create an equation with the variable n.

Please help! Thank you!

n = 2k+1

n^2 = 4k^2 + 4k + 1 = 4k(k+1) + 1
Now, either k or k+1 is even, so 4k(k+1) is a multiple of 8
so n^2 =1 (mod 8)

Thank you so much!

To prove that n^2 is congruent to 1 modulo 8 for any odd number n, you need to use a more general approach that doesn't involve substituting individual values of n. Here is a step-by-step proof:

1. Let's start by writing down the given statement: n^2 ≡ 1 (mod 8), where n is an odd number.

2. An odd number can be written in the form n = 2k + 1, where k is an integer.

3. Substitute n = 2k + 1 into the equation: (2k + 1)^2 ≡ 1 (mod 8).

4. Expand the left side of the equation: 4k^2 + 4k + 1 ≡ 1 (mod 8).

5. Simplify the equation by subtracting 1 from both sides: 4k^2 + 4k ≡ 0 (mod 8).

6. Factor out 4 from the left side of the equation: 4(k^2 + k) ≡ 0 (mod 8).

7. Divide both sides of the equation by 4: k^2 + k ≡ 0 (mod 2).

8. Notice that k(k + 1) is always divisible by 2 because one of the numbers is even and the other is odd. Therefore, k^2 + k is always divisible by 2.

9. Since k^2 + k is divisible by 2, we can write it as k^2 + k = 2m, where m is an integer.

10. Substitute this back into the equation: 2m ≡ 0 (mod 2).

11. Divide both sides of the equation by 2: m ≡ 0 (mod 1).

12. The remainder after dividing any number by 1 is always 0. Therefore, m ≡ 0 (mod 1).

13. Since m is an integer, it can be any integer, so m ≡ 0 (mod 1) is always true.

14. From step 9, k^2 + k = 2m, we conclude that k^2 + k ≡ 0 (mod 2) is always true.

15. Therefore, we have established that n^2 ≡ 1 (mod 8) for any odd number n, using a general proof that does not rely on substituting individual values.

In summary, you don't need to test individual values of n to prove that n^2 ≡ 1 (mod 8) for odd numbers. Instead, by substituting n with 2k + 1 and applying modular arithmetic properties, you can prove the statement for any odd number.