# How to construct integer polynomial of degree $n$ which takes $n$ times the value $1$ and $n$ times the value $-1$ (in integer points)

Question is like in title:

For positive integer $n$ I want to construct a polynomial $w(x)$ of degree $n$ with integer coefficients such that there exist $a_1<a_2<\cdots<a_n$ (integer numbers) satisfying $w(a_1)=w(a_2)=\cdots=w(a_n)=1$ and $b_1<b_2<\cdots<b_n$ (also integer numbers) satisfying $w(b_1)=w(b_2)=\cdots=w(b_n)=-1$.

I am not sure if such polynomial even exists for every $n$.

EDIT: $a_i, b_i$ are not predetermined, as someone mentioned in a comment.

This is not possible for $n>3$. In fact, it is not possible to find a degree-$n$ polynomial $w(x)$ which has $n$ different integer roots of $w(x)=1$ and even one integer root (say $b$) of $w(x)=-1$. This is because, if $a_1,...,a_n$ are the roots of $w(x)=1$, $w(x)-1=c(x-a_1)...(x-a_n)$, where $c$ is an integer. Thus $w(b)-1$ is $c$ times a product of $n$ different integers, and since at most two of these can be $\pm 1$, and all others have absolute value at least $2$, if $n>3$ then $w(b)-1$ can't equal $-2$ -- it must have absolute value at least $2^{n-2}$.
 In fact what you asked for is not possible for $n=3$ either. For $w(b)-1=-2$ to have a solution we must have $(b-a_1)(b-a_2)(b-a_3)=-2$ so the three terms are $-1,+1,+2$. But if those are the three terms, then the order of them is determined, so there is at most one solution for $b.$ It is possible for $n=2$: take $w(x)=x^2-3x+1$. Then $w(x)=1$ has two solutions $x=0,3$ and $w(x)=-1$ has two solutions $x=1,2$.