We check that for n=3
x3−3x2+2x+6=(x+1)(x2−4x+6).
Suppose that for n=4 we have
x4−3x3+2x2+6=(x2+ax+b)(x2+cx+d).
Then, comparing the coefficients we obtain
a+c=−3,ac+b+d=2,bd=6.
The first equation implies that a and c are of different parity and therefore, by the second equality, b and d are of the same parity. This contradicts the third equation. Hence we may assume that n≥5. Suppose that we have
W(x)=P(x)Q(x),(1)
where
P(x)=akxk+ak−1xk−1+⋯+a1x+a0,
Q(x)=bn−kxn−k+bn−k−1xn−k−1+⋯+b1x+b0,
and ak=bn−k=±1. With no loss of generality we may assume that k≤⌊21n⌋<n−2 (because n≥5). Comparing the coefficients of both sides of (1) we obtain the following system of equations:
a0b0a0b1+a1b0=6,=0,
a0bk+a1bk−1+⋯+ak−1b1+akb0=0.
Now we can easily prove by induction that a0 divides a1,a2,…,ak. Indeed, having established this fact for a1,a2,…,al we write
0=a0(a0bl+1+a1bl+⋯+alb1+al+1b0)==a02bl+1+a0a1bl+⋯+a0alb1+6al+1,
and hence
6al+1=−(a02bl+1+a0a1bl+⋯+a0alb1).
We note that all the summands on the right hand side are divisible by a02, therefore the left hand side also has this property. Hence a0∣al+1.
But we have ak=±1; hence a0=±1 and with no loss of generality we may take a0=1 and then we have b0=6.
Now if we repeat the above arguments for the coefficients of Q, then we see that b0=6 divides b1,b2,…,bn−3 (we set, if necessary, bl=0 if l>n−k). Then we obtain a contradiction (bn−k=±1), unless n−k>n−3. We consider two cases.
The case of k=2. Then we arrive at
a0bn−k+a1bn−k−1+⋯+an−k−1b1+an−kb0=2,
a contradiction, because on the left hand side all the summands, except for the first one, are divisible by 6 and hence even, and the first summand is equal to ±1.
The case of k=1. Then the problem reduces to finding an integer root of the polynomial W; it is easy to check that if n is even there are no such roots; if n is odd, W(−1)=0.
Therefore the answer to the problem is: n is odd.