Using the fact that
Q(x)7m≡Q(x7m)(mod7)
for all polynomials Q(x) with integer coefficients and for all positive integers m, we see that the integers n=7k and n=7k+7l with 0≤k≤l satisfy the condition of the problem.
Now we will show that if n is not of this form, then it does not satisfy the condition of the problem. Without loss of generality we may assume that n is not divisible by 7.
As n>2, the coefficient of x3 in Pn(x) is n(n−1). If 7∣n(n−1), then 7∣n−1. Let a≥1 and b≥2 be integers such that 7∤b and n=1+7ab. Then we have
the following set of congruences modulo 7:
(x2+x+1)n≡(x2+x+1)(x2+x+1)7a≡(x2+x+1)(x2⋅7a+x7a+1)b≡1+x+x2+bx7a+bx7a+1+bx7a+2+(terms of order 2⋅7a or larger)
(x+1)n≡1+x+bx7a+bx7a+1+(terms of order 2⋅7a or larger)
(x2+1)n≡1+x2+(terms of order 2⋅7a or larger)
(x2+x)n≡(sum of terms of order 2⋅7a or larger)
(In the last congruence we used the fact that b≥2.) Putting these together we get
Pn(x)≡bx7a+2+(terms of order 2⋅7a or larger)(mod7).
Since b is not divisible by 7, the coefficient of x7a+2 in Pn(x) is not divisible by 7.