For any positive integer $n$ the sum $\displaystyle 1+\frac 12+ \cdots + \frac 1n$ is written in the form $\displaystyle \frac{P(n)}{Q(n)}$, where $P(n)$ and $Q(n)$ are relatively prime. 

a) Prove that $P(67)$ is not divisible by 3;

b) Find all possible $n$, for which $P(n)$ is divisible by 3.
### Part (a): Prove that \( P(67) \) is not divisible by 3

1. **Define the Harmonic Sum**:
   Let \( S_n = \sum_{i=1}^n \frac{1}{i} \). We need to show that the numerator of \( S_{67} \) is not divisible by 3.

2. **Use 3-adic Valuation**:
   For a rational number \( x \), let \( \nu_3(x) \) denote the largest integer \( k \) such that \( \frac{x}{3^k} \) is an integer. The key property of 3-adic valuation is:
   \[
   \nu_3(A + B) \geq \min(\nu_3(A), \nu_3(B))
   \]
   with equality if \( \nu_3(A) \neq \nu_3(B) \).

3. **Analyze \( S_{3n} \)**:
   \[
   S_{3n} = \frac{1}{3}S_n + \sum_{i=1, 3 \nmid i}^{3n} \frac{1}{i}
   \]
   Let \( \sum_{i=1, 3 \nmid i}^{3n} \frac{1}{i} = \frac{a_n}{b_n} \), where \( b_n \) is not a multiple of 3 and \( a_n \) is a multiple of 3. Then:
   \[
   S_{3n} = \frac{S_n b_n + 3a_n}{3b_n}
   \]
   Since \( b_n \) is not a multiple of 3, \( \nu_3(b_n) = 0 \).

4. **Valuation Analysis**:
   \[
   1 + \nu_3(S_{3n}) = \nu_3(3S_n b_n) = \nu_3(S_n b_n + 3a_n)
   \]
   If the numerator of \( S_n \) is not divisible by 9 (i.e., \( \nu_3(S_n) \leq 1 \)), then \( 9 \mid 3a_n \) and:
   \[
   1 + \nu_3(S_{3n}) = \nu_3(S_n)
   \]
   Thus, the numerator of \( S_{3n} \) is not divisible by 3.

5. **Inductive Argument**:
   If \( n \) is "bad" (numerator of \( S_n \) not divisible by 3), then \( 3n \), \( 3n+1 \), and \( 3n+2 \) are also bad.

6. **Initial Values**:
   \[
   S_1 = 1, \quad S_2 = \frac{3}{2}, \quad S_3 = \frac{11}{6}, \quad S_4 = \frac{25}{12}, \quad S_5 = \frac{137}{60}, \quad S_6 = \frac{147}{60}, \quad S_7 = \frac{363}{140}, \quad S_8 = \frac{761}{280}
   \]
   From these, \( 2 \) and \( 7 \) are good, while \( 1, 3, 4, 5, 6, 8 \) are bad.

7. **Extend to \( n = 67 \)**:
   By induction, since \( 2 \) and \( 7 \) are good, and \( 67 \) is not a multiple of 3, 67 is bad. Therefore, \( P(67) \) is not divisible by 3.

### Part (b): Find all \( n \) for which \( P(n) \) is divisible by 3

1. **Identify Good Numbers**:
   From the initial values and the inductive argument, we see that \( 2 \) and \( 7 \) are good.

2. **Check Further Values**:
   By extending the calculations, we find that \( 22 \) is good, while \( 21 \) and \( 23 \) are bad.

3. **Conclusion**:
   Using the inductive argument, the only \( n \) for which \( P(n) \) is divisible by 3 are \( n = 2, 7, 22 \).

The final answer is \( \boxed{ n = 2, 7, 22 } \)