Find a rational function $R(x)$ such that:
$1)$ For $i\in\{2,\dots,g\}$$i\in\{1,\dots,g\}$, $x_{i}=x_{i-1}+g$ with $x_1=g$$x_0=0$.
$2)$ For $i\in\{1,\dots,g-1\}$$i\in\{0,\dots,g-1\}$ $R(x_i)=R(x_i+1)=\dots=R(x_i+g-1)=i$$R(x_i)=R(x_i+1)=\dots=R(x_i+g-1)=i+1$.
$3)$ $R(x_g)=g$$R(x_g)=g+1$.
So $R(x)$ is defined at $(g-1)g+1$$g^2+1$ points.
These points and the value taken by these points have an arithmetic progression structure and I know that Lagrange interpolation gives $O(g^2)$ polynomial.
However is there a degree $O(g)$ rational function $R(x)$ that takes advantages of the structure in the conditions?