TITLE: Polynomial-time algorithm for determining whether a polynomial is positive on $\mathbb{N}$
QUESTION [8 upvotes]: Does there exist a polynomial-time algorithm to determine whether a given polynomial $p(n)$ with integer coefficients is positive on $\mathbb{N}$, in the sense that $p(n) \geq 0$ for all $n\in\mathbb{N}$?
This question seems to be related, but it involves multivariable polynomials and asks about positivity on all of $\mathbb{R}^n$, and the answer doesn't seem to apply to single-variable polynomials.
Edit: Just to clarify, the input for the algorithm should be a string that encodes the polynomial $p$ in a reasonably compact fashion, e.g. the digits of the degree of $p$ followed by the digits of the coefficients.

REPLY [11 votes]: Yes.  Compute a Sturm sequence and use binary search to locate the real roots.

REPLY [7 votes]: Yes, sure, this can be done.
You can "find" all the roots of $f$ on the real axis in polynomial time. More precisely, you can find intervals $[a_i,b_i]$ ($i=1,\dots, d$) with rational endpoints $a_i$, $b_i$, so that  $f$ is monotonic on $[a_i,b_i]$ and $f(a_i)f(b_i)<0$, and so $x_i\in [a_i,b_i]$ is a real root of $f$. Assuming these intervals are ordered from left to right, you easily test whether there is a positive integer between $x_{2j-1}$ and $x_{2_j}$ (this is for the case of even degree $f$; for the odd degree the first $x_i$ can be ignored).
This will pin the finitely many (at most the degree of $f$) positive integers of which $f$ might be negative.