Find all positive integers $n$ such that $$\phi(n) + \sigma(n) = 2n + 8.$$
To find all positive integers \( n \) such that 
\[ \phi(n) + \sigma(n) = 2n + 8, \]
we will analyze the properties of the Euler's totient function \(\phi(n)\) and the sum of divisors function \(\sigma(n)\).

1. **Lower Bound Analysis**:
   Note that for any positive integer \( n \),
   \[ \phi(n) \ge n - \sum_{p \mid n} \frac{n}{p} \]
   and
   \[ \sigma(n) \ge n + \sum_{p \mid n} \frac{n}{p}, \]
   where the sums are taken over all distinct prime divisors \( p \) of \( n \).

2. **Combining Inequalities**:
   Adding these inequalities, we get:
   \[ \phi(n) + \sigma(n) \ge 2n. \]
   Equality holds if and only if \( n \) is a prime number.

3. **Considering the Given Equation**:
   We need to find \( n \) such that:
   \[ \phi(n) + \sigma(n) = 2n + 8. \]
   This implies that the excess over \( 2n \) is exactly 8.

4. **Case Analysis**:
   - **Case 1: \( n \) is a prime number**:
     If \( n \) is prime, then \(\phi(n) = n-1\) and \(\sigma(n) = n + 1\). Thus,
     \[ \phi(n) + \sigma(n) = (n-1) + (n+1) = 2n. \]
     This does not satisfy the equation \( \phi(n) + \sigma(n) = 2n + 8 \).

   - **Case 2: \( n \) has exactly two distinct prime factors**:
     Let \( n = p^k q^\ell \) where \( p \) and \( q \) are distinct primes.
     Then,
     \[ \phi(n) = n \left(1 - \frac{1}{p}\right) \left(1 - \frac{1}{q}\right) \]
     and
     \[ \sigma(n) = \frac{p^{k+1} - 1}{p - 1} \cdot \frac{q^{\ell+1} - 1}{q - 1}. \]
     We need to check if there are any values of \( p, q, k, \ell \) such that:
     \[ \phi(n) + \sigma(n) = 2n + 8. \]

     - **Subcase: \( n = p^k \)**:
       If \( n = p^k \), then:
       \[ \phi(n) = p^k \left(1 - \frac{1}{p}\right) = p^k - p^{k-1}, \]
       \[ \sigma(n) = 1 + p + p^2 + \cdots + p^k = \frac{p^{k+1} - 1}{p - 1}. \]
       Thus,
       \[ \phi(n) + \sigma(n) = p^k - p^{k-1} + \frac{p^{k+1} - 1}{p - 1}. \]
       We need to solve:
       \[ p^k - p^{k-1} + \frac{p^{k+1} - 1}{p - 1} = 2p^k + 8. \]
       Trying \( p = 7 \) and \( k = 3 \):
       \[ n = 7^3 = 343, \]
       \[ \phi(343) = 343 \left(1 - \frac{1}{7}\right) = 343 \cdot \frac{6}{7} = 294, \]
       \[ \sigma(343) = 1 + 7 + 49 + 343 = 400, \]
       \[ \phi(343) + \sigma(343) = 294 + 400 = 694, \]
       \[ 2 \cdot 343 + 8 = 686 + 8 = 694. \]
       This satisfies the equation.

     - **Subcase: \( n = p^k q \)**:
       If \( n = p^k q \), then:
       \[ \phi(n) = p^k q \left(1 - \frac{1}{p}\right) \left(1 - \frac{1}{q}\right), \]
       \[ \sigma(n) = \left(1 + p + p^2 + \cdots + p^k\right) \left(1 + q\right). \]
       Trying \( p = 2, k = 2, q = 3 \):
       \[ n = 2^2 \cdot 3 = 12, \]
       \[ \phi(12) = 12 \left(1 - \frac{1}{2}\right) \left(1 - \frac{1}{3}\right) = 12 \cdot \frac{1}{2} \cdot \frac{2}{3} = 4, \]
       \[ \sigma(12) = (1 + 2 + 4)(1 + 3) = 7 \cdot 4 = 28, \]
       \[ \phi(12) + \sigma(12) = 4 + 28 = 32, \]
       \[ 2 \cdot 12 + 8 = 24 + 8 = 32. \]
       This satisfies the equation.

5. **Conclusion**:
   The solutions are \( n = 343 \) and \( n = 12 \).

The final answer is \( \boxed{n = 343 \text{ and } n = 12} \).