# Determining whether polynomial will produce even, odd, or both even and odd values for an integer argument [closed]

I had a neat realization while solving a problem in my real analysis course, and came up with a nice way to further generalize it. Let me know your thoughts, extensions, or if this methodology is already existent. My work is provided below. The question that suits this problem is:

Is there a way to determine whether an $n^{th}$ degree polynomial with integer coefficients produces odd, even, or both even and odd integer values for an integer argument?

## closed as unclear what you're asking by marwalix, user91500, Ian Miller, Harsh Kumar, RohanJan 10 '17 at 14:32

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

For an integer $x$, let $spn(x)$ be defined by:

$$spn(x) = \begin{cases} 0, & \text{if x is even} \\ 1, & \text{if x is odd} \end{cases}$$

To keep things consistent with the properties of odds and evens, we have: $$spn(xy) = spn(x)spn(y)$$ $$spn(x^n) = spn(x)$$ $$spn(x+y) = spn(x) + spn(y) \space \space (mod \space 2)$$

For example,

$$spn(x^2+5x+1) = spn(x^2)+spn(5)spn(x)+spn(1) \space \space (mod \space 2)$$ $$=spn(x)+spn(x)+1 \space \space (mod \space 2) = 2spn(x) + 1\space\space(mod \space 2) = 1$$ Thus $$spn(x^2+5x+1) = 1 \space\space\space\space\space\space\space\space\text{for all integers x}$$

And so, $x^2+5x+1$ always produces odd numbers for an integer $x$. For generality, let the $m^{th}$ degree polynomial $p(x)$ with integer coefficients $c_n$ be defined as:

$$p(x) = c_0 + \sum_{n=1}^m c_n x^n$$ $$spn(p(x)) = spn(c_0) + spn(x)\sum_{n=1}^m spn(c_n)\space\space(mod \space 2)$$ if $x$ is even, $$spn(p(x)) = spn(c_0)$$ if $x$ is odd, $$spn(p(x)) = \sum_{n=0}^m spn(c_n)\space\space(mod \space 2)$$

From the earlier example, we can then conclude that $spn(x^2+5x+1) = 1$ for all integers $x$ because $spn(c_0) = spn(1) = 1$ and $\sum_{n=0}^2 spn(c_n)\space\space(mod \space 2) = spn(1) + spn(5) + spn(1) \space\space (mod\space 2) = 1$

Since $spn(c_0) = \sum_{n=0}^2 spn(c_n)\space\space(mod \space 2)=1$, $spn(x^2+5x+1) = 1$ for both even and odd integers $x$. Therefore, $x^2+5x+1$ only produces odd numbers for any integer $x$.

In general, an $n^{th}$ degree polynomial will produce only odd integer values for an integer $x$ if both $c_0$ and the sum off all coefficients is odd; and will only produce even values if $c_0$ is even and the sum of all coefficients is even. If $c_0$ is odd and the sum of coefficients is even, $p(x)$ will produce odd values for even $x$ and even values for odd $x$. If $c_0$ is even and the sum of coefficients is odd, $p(x)$ will produce even values for odd $x$ and odd values for even $x$.

• $x^2+5x+1$ has two irrational roots. So no integer roots and a fortiori no even integer roots. – marwalix Jan 10 '17 at 5:53
• @marwalix: sorry, I used the wrong terminology there. I meant that $x^2+5x+1$ always produces an odd number for an integer $x$. I've edited the post to support that. Thanks for the catch. – infinitylord Jan 10 '17 at 5:55
• Ok got your point – marwalix Jan 10 '17 at 5:59

For $j\in \mathbb N$ and $x\in \mathbb Z$ we have $x^j\equiv x \pmod 2.$ So for $n>0$ we have $$\sum_{j=0}^nA_jx^j\equiv A_0+x\sum_{j=1}^nA_j \pmod 2.$$ Since each of the constants $A_0,\;\sum_{j=1}^nA_j$ is congruent, mod $2$, to a member of $\{0,1\},$ the rest should be obvious.