Alice and Bob are in a hardware store. The store sells coloured sleeves that fit over keys to distinguish them. The following conversation takes place:
[color=#0000FF]Alice:[/color] Are you going to cover your keys?
[color=#FF0000]Bob:[/color] I would like to, but there are only $7$ colours and I have $8$ keys.
[color=#0000FF]Alice:[/color] Yes, but you could always distinguish a key by noticing that the red key next to the green key was different from the red key next to the blue key.
[color=#FF0000]Bob:[/color] You must be careful what you mean by "[i]next to[/i]" or "[i]three keys over from[/i]" since you can turn the key ring over and the keys are arranged in a circle.
[color=#0000FF]Alice:[/color] Even so, you don't need $8$ colours.
[b]Problem:[/b] What is the smallest number of colours needed to distinguish $n$ keys if all the keys are to be covered.
To determine the smallest number of colors needed to distinguish \( n \) keys arranged in a circle, we need to consider the symmetries of the circle, which include rotations and reflections. Let's analyze the problem step-by-step.

1. **Case \( n \leq 2 \):**
   - For \( n = 1 \), only one color is needed.
   - For \( n = 2 \), two colors are needed because one color would make the keys indistinguishable.

2. **Case \( n \geq 6 \):**
   - We can use 2 colors to distinguish the keys. Consider the pattern \( RRBRBB \ldots B \), where there are at least 2 B's at the end.
   - If the ring is turned over, the lone B will have the lone R to its left instead of its right, allowing us to detect the flip.
   - Any rotation can be canceled by ensuring the two R's are at the front.

3. **Case \( n = 3, 4, 5 \):**
   - For these values of \( n \), 3 colors are needed. A possible construction is to use R, B, and the rest G.
   - A flip can be detected because we will have BR instead of RB.
   - Rotations can be canceled by moving R to the front.

4. **Proof that 1 color does not suffice for \( n \geq 2 \):**
   - If all keys are the same color, they are indistinguishable regardless of the arrangement.

5. **Proof that 2 colors fail for \( n = 3, 4, 5 \):**
   - There are \( 2n \) symmetries of the keyring (rotations and reflections).
   - If we have \( k \) keys of one color and \( n-k \) of the other, there are \( \binom{n}{k} \) possible arrangements.
   - For \( n = 3, 4 \), \( \binom{n}{k} < 2n \) for any \( k \), so we can't distinguish all symmetries.
   - For \( n = 5 \), consider \( k = 2 \) (or \( k = 3 \), which is symmetric). There are two configurations: BRBRR and BBRRR.
     - These can be rotated to RBRBR and BRRRB, respectively, where we can't detect turning over the keyring.

Thus, the smallest number of colors needed to distinguish \( n \) keys is:
- \( n \) colors for \( n \leq 2 \)
- 3 colors for \( n = 3, 4, 5 \)
- 2 colors for \( n \geq 6 \)

The final answer is \( \boxed{3} \) for \( n = 3, 4, 5 \), and \( \boxed{2} \) for \( n \geq 6 \).