Given $a \in \mathbb{Z}$ with $a > 1$. Let $g(x) \in \mathbb{Z}[x]$ be a polynomial with $g(a)=\pm 1$. Let $h(x) \in \mathbb{Z}[x]$ be a polynomial with $h(a)= p$, a prime. Let $g(x)$ and $h(x)$ have not all coefficients negative nor positive. Can $g(x)h(x)$ have only positive or only negative coefficients? Is there a way to generate such polynomials? What if $a < 1$? The motivation is to test if a given polynomial has only positive coefficients and assumes a prime value at a positive integer larger than $1$, then it is irreducible.

I got good answers for the above question. The answer includes the phrase "...the last few coefficients of $g(x)h(x)$ are large enough...". Is there a way to overcome this?

Adding one additional constraint:

The given polynomials $g(x)$ and $h(x)$ have constant coefficient $\pm 1$ with $g(x)h(x)$ having constant coefficient $1$, $g(a)h(a)$ a prime for some $a > 1$, say $a=2$.

  • $\begingroup$ Please do not omit the 'ac.' prefix (I changed it). Also providing some motivation for this question seems like a good idea. $\endgroup$
    – user9072
    Feb 12 '13 at 12:36
  • $\begingroup$ Posted earlier to m.se, math.stackexchange.com/questions/300055/… $\endgroup$ Feb 12 '13 at 22:32
  • $\begingroup$ @Gerry Could not delete that question since someone posted an answer that does not satisfy the needs $\endgroup$
    – Mr.
    Feb 12 '13 at 22:52
  • 2
    $\begingroup$ You are really getting on my nerves. Every time someone solves your problem, you move the goalposts. 15 revisions! Why don't you go away for a couple of weeks, think your problem through from every angle, and, when you are finally sure that you really, really, really are ready to state your problem in full, come back and ask your question. $\endgroup$ Feb 14 '13 at 11:16
  • 2
    $\begingroup$ @Gerry: I feel the same... $\endgroup$ Feb 14 '13 at 11:43

$$ g(x)h(x)=(x^2-4x+5)(x^{14}+5x^{13}+16x^{12}+40x^{11}+81x^{10}+125x^9+96x^8 $$ $$ \qquad -x^7+6x^5+25x^4+71x^3+160x^2+286x+355) $$ $$ =x^{16}+x^{!5}+x^{14}+x^{13}+x^{12}+x^{11}+x^{10}+240x^9+484x^8 $$ $$ + x^7 + x^6 + x^5 + x^4 + x^3 + 11x^2 + 10x + 1775. $$ $g(2)=1$, $h(2)=378919$.

In fact, it is known that each polynomial with no nonnegative real roots has a multiple with only positive coefficients. Moreover, there exists a large variety of such polynomials, hence there is nothing special in such an example.

So, having obtained $h(x)$ such that the last few coefficients of $g(x)h(x)$ are large enough, you may change few its last coefficients to make $h(a)$ prime. That's how this concrete example was obtained: first, I have found one by one the coefficients of $h(x)$ so that the first coefficients of the product are ones and the next two are positive, then I have added the negative coefficient and repeated the procedure, and then I have changes the last coefficient to make $h(2)$ prime.

It might be helpful to notice the following fact. If $g(x)$ has a complex root with argument $\alpha$, then each its multiple $p(x)$ with nonnegative coefficients has the degree at least $\pi/\alpha$. To see this, just substitute that root into $p(x)$ and look at the sign of the imaginary part.

EDIT, I'm a bit lazy to construct an explicit example with the last coefficients $\pm1$, sorry; but here is the way.

Take $g(x)=x^2(x-2)^2+1$. In the same way you may find the polynomial $h(x)$ such that $g(x)h(x)$ has positive coefficients (and $h(x)$ does not) --- since $g(x)$ has no nonnegative real roots. Next, consider $g_1(x)=x^4g(1/x)$ and construct the corresponding polynomial $h_1(x)$, say of degree $n$ (we need $h_1$ to have $1$ as the leading coefficient; it is surely possible).

It remains to notice that $g(x)(x^{n+5}h(x)+x^nh_1(1/x))$ is almost the desired example; you just need to change the appropriate coefficients of $h$ and $h_1$ to make the corresponding value prime. I am almost sure thath this is possible...

Notice that one may even decrease the exponent $n+5$ (the only fact to check is that the second factor should have a negative coefficient, and that of $h(x)$ is somewhere in the middle).

  • $\begingroup$ pretty good example and explanation $\endgroup$
    – Mr.
    Feb 13 '13 at 19:24
  • $\begingroup$ what if $g(x)h(x)$ has last constant coefficient $1$? $\endgroup$
    – Mr.
    Feb 13 '13 at 19:29
  • $\begingroup$ I have added the way of constructing such an example. $\endgroup$ Feb 14 '13 at 7:29
  • $\begingroup$ Well, the construction blows up not the higher terms, but the terms in the middle... $\endgroup$ Feb 14 '13 at 11:51


$g(-3)=1$, $h(-3)=-47$.

  • $\begingroup$ Do you have an example for $a > 1$? $\endgroup$
    – Mr.
    Feb 13 '13 at 1:19
  • $\begingroup$ No, nor do I have a firm opinion on whether one's possible. To make the coefficients of the product all positive, I think you want the negative coefficients in the factors to be few and small, which tends to make the factors big at positive arguments. But maybe you can get around that tendency by going to higher degree. $\endgroup$ Feb 13 '13 at 4:40
  • $\begingroup$ how high of a degree do you expect? $\endgroup$
    – Mr.
    Feb 13 '13 at 6:15
  • $\begingroup$ Sorry, I'm all out of intuition. I'll defer to Ilya. $\endgroup$ Feb 13 '13 at 22:02
  • $\begingroup$ Hi Gerry: His answer provides a good example. I will need the constant coefficient to be $1$ as in your example. His answer includes the phrase "the last few coefficients of g(x)h(x) are large enough" which precludes what I am looking for. $\endgroup$
    – Mr.
    Feb 13 '13 at 22:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.