Does there any theorem with algorithm which says, any polynomial $P$ and $Q$ with common variable then $P$ can be represented in terms of $Q$ as $$P=\sum_{i\in S}P_iQ^i$$ and there exists unique polynomials $P_i$ have same degree for all $i$ and $S\subset\mathbb{Z}$.
For example: Sum of cube of first natural number is square of sum of first natural number that is
$P(n) = \sum_{k=1}^n k^3$ and $Q(n)= \sum_{k=1}^n k$ and $P(n)= 1\cdot Q^2(n)+0\cdot Q(n)+\ldots$
I'm not taking about polynomial division algorithm. Thanks.