If $m$ and $n$ are even and odd or odd and even, then $m-n$ is odd and so the lockers numbered $m$ and $n$ must have different colours.

Thus, none of the even-numbered lockers (we call these "even lockers") can be painted the same colour as any of the odd-numbered lockers ("odd lockers").

(If $m$ and $n$ are both odd or both even, then $m-n$ is even, so there is no restriction.)

This means that we cannot use all three colours in painting the even lockers and we cannot use all three colours in painting the odd lockers, otherwise there would be no colours left to use for the other set.

Thus, one or two colours are used to paint the even lockers and one or two colours are used to paint the odd lockers.

Furthermore, we cannot use two colours to paint the even lockers and two colours to paint the odd lockers, otherwise there would be a colour that overlaps.

Thus, either one colour is used for the even lockers and one colour for the odd lockers (it is not required that all three colours be used), or one colour is used for the even lockers and two colours for the odd lockers, or two colours are used for the even lockers and one colour for the odd lockers.

We count the number of ways of painting in the first and second cases. The number of ways of painting in the third case will be equal to the number of ways from the second case (the roles of the even and odd lockers can be exchanged since there is an equal number of even lockers and odd lockers).

Case 1: One colour for even lockers and one colour for odd lockers

There are three choices of colour for the even lockers (any of the three colours).

There are then two choices of colour for the odd lockers (either of the remaining colours).

In this case, there are $3 \times 2=6$ ways of colouring the lockers.

## Case 2: One colour for even lockers and two colours for odd lockers

There are three choices of colour for the even lockers.

For each of these three choices, the odd lockers must be painted with the two remaining colours (there is no choice of the colours), making sure to use each colour on at least one locker.

For each of the five odd lockers, there are two choices of colour, so there are $2^{5}$ ways of painting the odd lockers using at most these two colours. We subtract 2 ways from this total: one for painting them all one colour and one for painting them all the other colour (since these was counted in Case 1). Thus, there are $32-2=30$ ways of painting the odd lockers using exactly two colours.

In total, there are thus $3 \times 30=90$ ways of painting the lockers in this case.

Case 3: Two colours for even lockers and one colour for odd lockers

As in case 2, there are 90 ways of painting the lockers.

In total, there are $6+90+90=186$ ways of painting the lockers.

## Part B
Ten lockers are in a row. The lockers are numbered in order with the positive integers 1 to 10. Each locker is to be painted either blue, red or green subject to the following rules:

- Two lockers numbered $m$ and $n$ are painted different colours whenever $m-n$ is odd.
- It is not required that all 3 colours be used.

In how many ways can the collection of lockers be painted?

## PART B

For each question in Part B, your solution must be well organized and contain words of explanation or justification. Marks are awarded for completeness, clarity, and style of presentation. A correct solution, poorly presented, will not earn full marks.