(x+1) is a factor of xn+1 only if
Let f (x) = xⁿ +1
Since, x+ 1 is a factor of f (x), so
f (-1) = 9
Thus, n is an odd integer.