Given a positive integer $k > 1$, find all positive integers $n$ such that the polynomial $$P(z) = z^n + \sum_{j=0}^{2^k-2} z^j = 1 +z +z^2 + \cdots +z^{2^k-2} + z^n$$ has a complex root $w$ such that $|w| = 1$.
1. **Define the polynomial and the given conditions:**
   Given the polynomial:
   \[
   P(z) = z^n + \sum_{j=0}^{2^k-2} z^j = 1 + z + z^2 + \cdots + z^{2^k-2} + z^n
   \]
   We need to find all positive integers \( n \) such that \( P(z) \) has a complex root \( w \) with \( |w| = 1 \).

2. **Simplify the polynomial:**
   Let \( a = 2^k - 2 \). Then the polynomial can be rewritten as:
   \[
   P(z) = \frac{z^{a+1} - 1}{z - 1} + z^n
   \]
   Since \( w \) is a root, we have:
   \[
   \frac{w^{a+1} - 1}{w - 1} + w^n = 0
   \]
   Assuming \( w \neq 1 \) (since 1 is obviously not a root), we get:
   \[
   \frac{w^{a+1} - 1}{w - 1} = -w^n
   \]

3. **Take the modulus on both sides:**
   Since \( |w| = 1 \), we have:
   \[
   \left| \frac{w^{a+1} - 1}{w - 1} \right| = |-w^n| = 1
   \]
   Using the property \( \bar{w} = \frac{1}{w} \) and \( |z|^2 = z \bar{z} \), we simplify:
   \[
   \left| \frac{w^{a+1} - 1}{w - 1} \right| = 1
   \]

4. **Simplify the expression:**
   We can further simplify the expression:
   \[
   \frac{(w^{a+1} - 1)^2}{w^{a+1}} = \frac{(w - 1)^2}{w}
   \]
   This leads to:
   \[
   0 = w^{2a+2} + 1 - w^{a+2} - w^a = (w^{a+2} - 1)(w^a - 1)
   \]

5. **Analyze the cases:**
   We have two cases:
   - \( w^{a+2} = 1 \)
   - \( w^a = 1 \)

6. **Case 1: \( w^{a+2} = 1 \):**
   \[
   w^{a+2} = w^{2^k} = 1
   \]
   This implies:
   \[
   w^{n+1} = 1
   \]
   Using the Euclidean algorithm, we have:
   \[
   w^{\gcd(2^k, n+1)} = 1
   \]
   We have a solution if \( \gcd(2^k, n+1) > 1 \), which is true when \( n \) is odd.

7. **Case 2: \( w^a = 1 \):**
   \[
   w^a = w^{2^k - 2} = 1
   \]
   This implies:
   \[
   w^n = -1
   \]
   Using the Euclidean algorithm and letting \( d = \gcd(n, 2^k - 2) \), we have:
   \[
   w^d = -1
   \]
   We must also have:
   \[
   (w^d)^{\frac{2^k - 2}{d}} = (-1)^{\frac{2^k - 2}{d}} = 1
   \]
   So, \( d \) is a divisor of \( 2^{k-1} - 1 \). Since \( 2^{k-1} - 1 \) is odd, \( d \) is also odd. All \( n = d(2u + 1) \) should be a possible choice, but this is clearly an odd number, so we have no further solutions in this case.

The final answer is \( \boxed{ n } \) is odd.