The polynomial $x^{2n}+1+(x+1)^{2n}$ is not divisible by $x^2+x+1$ if $n$ equals

$\text{(A)} \ 17 \qquad \text{(B)} \ 20 \qquad \text{(C)} \ 21 \qquad \text{(D)} \ 64 \qquad \text{(E)} \ 65$
To determine when the polynomial \( x^{2n} + 1 + (x+1)^{2n} \) is not divisible by \( x^2 + x + 1 \), we need to analyze the roots of the polynomial \( x^2 + x + 1 \). The roots of \( x^2 + x + 1 = 0 \) are the non-real cube roots of unity, denoted as \( \omega \) and \( \omega^2 \), where \( \omega = e^{2\pi i / 3} \) and \( \omega^2 = e^{-2\pi i / 3} \).

1. **Substitute \( \omega \) and \( \omega^2 \) into the polynomial:**
   \[
   P(x) = x^{2n} + 1 + (x+1)^{2n}
   \]
   We need to check if \( P(\omega) = 0 \) and \( P(\omega^2) = 0 \).

2. **Evaluate \( P(\omega) \):**
   \[
   P(\omega) = \omega^{2n} + 1 + (\omega + 1)^{2n}
   \]
   Since \( \omega^3 = 1 \), we have:
   \[
   \omega^{2n} = (\omega^3)^{\frac{2n}{3}} = 1^{\frac{2n}{3}} = 1 \quad \text{if} \quad 2n \equiv 0 \pmod{3}
   \]
   Also, \( \omega + 1 = -\omega^2 \) because \( \omega^2 + \omega + 1 = 0 \).

3. **Simplify \( (\omega + 1)^{2n} \):**
   \[
   (\omega + 1)^{2n} = (-\omega^2)^{2n} = (\omega^2)^{2n} = (\omega^3)^{\frac{2n}{3}} = 1^{\frac{2n}{3}} = 1 \quad \text{if} \quad 2n \equiv 0 \pmod{3}
   \]

4. **Combine the results:**
   \[
   P(\omega) = \omega^{2n} + 1 + (\omega + 1)^{2n} = 1 + 1 + 1 = 3 \quad \text{if} \quad 2n \equiv 0 \pmod{3}
   \]
   This implies \( P(\omega) \neq 0 \) if \( 2n \equiv 0 \pmod{3} \).

5. **Check the values of \( n \):**
   - For \( n = 17 \), \( 2n = 34 \equiv 1 \pmod{3} \)
   - For \( n = 20 \), \( 2n = 40 \equiv 1 \pmod{3} \)
   - For \( n = 21 \), \( 2n = 42 \equiv 0 \pmod{3} \)
   - For \( n = 64 \), \( 2n = 128 \equiv 2 \pmod{3} \)
   - For \( n = 65 \), \( 2n = 130 \equiv 1 \pmod{3} \)

Since \( P(x) \) is not divisible by \( x^2 + x + 1 \) when \( 2n \equiv 0 \pmod{3} \), the only value of \( n \) that satisfies this condition is \( n = 21 \).

The final answer is \( \boxed{21} \)