Constructing a vector consisting of nonnegative entries Consider constructing a vector $v=(a_1,a_2,\ldots,a_n)$ consisting of nonnegative integers such that $a_1=1$ and, if $a_j$'s are nonzero, then $a_j\equiv a_{n-j+2}+j-1 \pmod m\ \forall 1<j\le\frac{n}{2}$, where $m$ is the number of nonzero entries; with the additional constraint that all nonzero $a_i$'s are distinct modulo $m$. Note that  the number $m$ itself appears once as a nonzero number satisfying the above congruence. 
Is it always possible to construct such a vector? I think this should be possible if $m$ is odd. For example, $(1,4,2,5,3)$ and $(1,4,2,0,0,5,3)$ are such vectors. It is easy to construct if the first  entries (within $\lfloor\frac{n}{2}\rfloor$) of the vector are consecutive. But, in other cases, it is not clear as to how to proceed with the construction. Any hints? Thanks beforehand.
 A: Yes, such construction is always possible.
Consider two sets of pairs of values:
$$\big\{ (2+t,m-t)\quad :\quad t=0\,..\,\lfloor\frac{m-1}{4}\rfloor-1\big\},$$
where differences of elements modulo $m$ are: $2,4,\dots,2\cdot\lfloor\frac{m-1}{4}\rfloor$, and
$$\big\{ (\lfloor\frac{m+1}{2}\rfloor+t+1,\lfloor\frac{m+1}{2}\rfloor-t)\quad :\quad t=0\,..\,\lfloor\frac{m+1}{4}\rfloor-1\big\},$$
where differences of elements modulo $m$ are: $1, 3, \dots, 2\cdot\lfloor\frac{m+1}{4}\rfloor-1.$ Together they give all differences from $1$ to $\lfloor\frac{m-1}{2}\rfloor$.
Notice that all elements forming pairs in these sets are $\ne0,1$ and are distinct modulo $m$.
Therefore, it's enough to assign the values from these sets to the corresponding pairs $(a_j,a_{n+2-j})$, giving $2\cdot\lfloor\frac{m-1}{2}\rfloor$ nonzero $a_j$'s. If $m$ is even we need to assign one more yet unassigned nonzero value (which is  $\lfloor\frac{3m}{4}\rfloor+1$) to any of yet unassigned $a_j$ with $j>\frac{n}2$. The other unassigned $a_j$ are set to zero.

ADDED. Here is a SageMath code implementing the above construction. There is a sample call construct_a(16,11), which constructs vector $(a_1,\dots,a_n)$ for parameters $n=16$ and $m=11$.
