✔ 最佳答案
First, let's prove a simpler statement:
If n is odd, then n² ≡ 1 (mod 8)
Proof. Let n be odd. Then there exists an integer k ∈ Z such that n = 2k + 1. Thus we have
the following:
n² - 1 = (2k + 1)² - 1
= 4k² + 4k + 1 - 1
= 4k(k + 1)
Now consider the product k(k + 1). If k is even, then k(k + 1) is even. If k is odd, then k + 1
is even and hence k(k + 1) is even. Hence in either case k(k + 1) is even. So there exists ℓ ∈ Z
such that k(k + 1) = 2ℓ. Therefore we have n² − 1 = 4k(k + 1) = 4(2ℓ) = 8ℓ. Thus 8 | n² − 1,
so n² ≡ 1 (mod 8), for any odd value of n.
Let's go back to the original question. Another way to restate this is:
If n is an odd natural number, then n^n - n ≡ 0 (mod 8)
Factor out n:
n(n^(n-1) - 1) ≡ 0 (mod 8)
Obviously n is odd, so it can't be congruent to 0 (mod 8). But if we can show that n^(n-1) - 1 ≡ 0 (mod 8) we have proven the original statement.
Since n is odd, then n - 1 is even. So let's replace n-1 with 2m, where m is an integer.
n^(2m) - 1
That can be further changed into:
(n^m)² - 1
n is an odd number.
An odd number multiplied by an odd number is still odd.
So an odd number to an integer power is odd, hence n^m is always odd.
But we already showed above that n² is congruent to 1 (mod 8) and when we subtract 1 we get that the whole statement is congruent to 0 (mod 8).
Working backwards:
If n is an odd natural number, then:
n² ≡ 1 (mod 8)
n² - 1 ≡ 0 (mod 8)
(n^m)² - 1 ≡ 0 (mod 8)
(n^2m) - 1 ≡ 0 (mod 8)
(n^(n-1) - 1) ≡ 0 (mod 8)
n(n^(n-1) - 1) ≡ 0 (mod 8)
n^n - n ≡ 0 (mod 8)
n^n = n (mod 8)