## Solution

### Proof.

We want to show that if a ≡ 2(mod 5) or a ≡ 3(mod 5) or if 5 divides a, then a2 + a4 ≡ 0(mod 5).

In other words, we want to show that a2 + a4 = 5k + 0, where k is an integer.

We will do this by considering each of the three cases separately.

First let’s note some theorems about modular arithmetic that will help us with our proof:

• If x ≡ m(mod d) and y ≡ n(mod d), then x + y ≡ m + n(mod d).

• If x ≡ m(mod d), then xn ≡ mn (mod d).

Case 1: a ≡ 2(mod 5)

Since a ≡ 2(mod 5), then a2 ≡ 22 (mod 5) and a4 ≡ 24 (mod 5).

a2 + a4 ≡ 22 + 24 (mod 5) ≡ 20(mod 5).

By the definition of mod, we can write a2 + a4 = 5b + 20 where b is an integer, or a2 + a4 = 5(b + 4) + 0.

Since b is an integer, b + 4 must also be an integer.

Therefore, if a ≡ 2(mod 5), then a2 + a4 ≡ 0(mod 5)

Case 2: a ≡ 3(mod 5)

Since a ≡ 3(mod 5), then a2 ≡ 32 (mod 5) and a4 ≡ 34 (mod 5).

a2 + a4 ≡ 32 + 34 (mod 5) ≡ 90(mod 5).

By the definition of mod, we can write a2 + a4 = 5c + 20 where c is an integer, or a2 + a4 = 5(c + 18) + 0.

Since c is an integer, c + 4 must also be an integer.

Therefore, if a ≡ 3(mod 5), then a2 + a4 ≡ 0(mod 5)

Case 3: 5 divides a

By the definition of divides, a = 5d, where d is an integer.

So, a2 + a4 = (5d)2 + (5d)4 = 25d2 + 625d4 = 5(5d2 + 125d4) + 0.

Since d is an integer, 5d2 + 125d4 must also be an integer.

Therefore, if 5 divides a, then a2 + a4 ≡ 0(mod 5).

If you would like to see a different solution or an implementation in a different programming language