I would like some general pointers on how to proceed with this problem I made up.

Let P(n) be a polynomial of degree n, in which x can only take integer values.

Oberve that:

P(1) = x will give odd and even values for its output (1,2,3,4...)

P(2) = (1/2)x^2 +(1/2)x gives two odd values and two even values (1,3,6,10,15,21,28,36)

P(4) = (1/24)x^4+(5/12)x^3+(35/24)x^2+(25/12)x gives four odd and four even values (0,4,14,34,69,125,209,329,494,714,1000,1364,1819.. .)

I have also found P(8) and it gives a sequence of eight odd/evens.

I solved a system of linear equations to find the polynomial coefficents (on my ti-92) and it is not a nice process!

Is there any polynomial which will give three odds/evens, five odds/evens etc ? I have tried but no luck so far. Ultimately I am looking for a polynomial which will give any combination (p odds, q evens).

Any hints, pointers and general advice is most welcome.

Many Thanks.