Solving a combinatorial problem I find that there are $p(n)=\frac{1}{24}(5n^3+3n^2-2n)$ solutions for even $n$ and $q(n)=\frac1{24}(5n^3+3n^2-5n-3)$ for odd $n$. Now I would like to find a "uninomial" that coincides with $p$ for all even values and with $q$ for all odd values.
A trivial example would be $p(n)+(\lceil\frac n2\rceil-\lfloor\frac n2\rfloor)(q(n)-p(n))$, but I want something more specific.
I want (in this case) an expression of the form $a_3p_3^3+a_2p_2^2+a_1p_1+a_0$, where each $p_i$ is either $n$ or $\lceil\frac n2\rceil$ or $\lfloor\frac n2\rfloor$ (and each $a_i$ is a real number).
Or, slightly more general, every $p_i^i$ may be replaced by a product of $i$ factors, each of which is either $n$ or $\lceil\frac n2\rceil$ or $\lfloor\frac n2\rfloor$.
The specific problem is small enough to succumb to a brute force attack by a computer program, but I am looking for a kind of mechanism.
Any ideas? Or a reference maybe? Stupid Google has never heard of a uninomial and I seem unable to find the keywords that may trap Google into revealing a relevant location.