We have n=2014. First, for a special choice of the coefficients ak, namely 2014 for even k and 2015 for odd k, define the polynomial Qn(X)=2014X2n+2015X2n−1+2014X2n−2+…+2015X+2014. We have Q2014(−1)=0, so the number sought is at most 2014. It remains to show that P(X) has no real zero for n≤2013. For x≥0 we have P(x)≥a0>0, since the coefficients are positive; for x<0 we have P(x)≥Qn(x), since xk is positive for even k, hence akxk≥2014xk, and xk is negative for odd k, hence akxk≥2015xk. It remains to show that Qm(x)>0 for m≤2013.
1st proof: One computes that for real x we have
Qm(x)=1007(ν=0∑m−1(xν+xν+1)2)+21(ν=0∑m−1(x2ν+1+1)(x2m−2ν−1+1))+(1007−2m)(x2m+1)
The summands of the first sum are non-negative, being squares. Since x2k+1+1 is positive, 0, or negative, respectively, for all k≥0 for x>−1, x=−1, or x<−1, respectively, the summands in the second sum are non-negative. Thus for x<0 and m≤2013 we have:
P(x)≥Qm(x)≥(1007−2m)(x2m+1)>21
2nd proof (using analysis): For x<0 define the real function fm(x)=(x2−1)Qm(x)=2014(x2m+2−1)+2015x(x2m−1). The second derivative fm′′(x)=2(2m+1)(2014(m+1)x2m+2015mx2m−1) has the unique negative zero xm=−2014(m+1)2015m>−1 for m≤2013, and we have
fm′(xm)=2014(2m+2)xm2m+1+2015(2m+1)xm2m−2015==(2014(2m+2)xm+2015(2m+1))xm2m−2015=2015⋅xm2m−2015<0
For x<xm or xm<x<0, respectively, fm′ is strictly increasing or strictly decreasing, respectively, since the derivative fm′′ is positive or negative, respectively; hence fm′ has a global maximum at x=xm for x<0 and is negative for all x<0. Hence fm is strictly decreasing, and thus, because of fm(−1)=0, is positive for x>−1 and negative for x<−1. Thus Qm(x) is positive for x=−1; for x=−1 we directly get Qm(−1)=2014−m>0.