Polynomial problem Let's assume that $P(2x)\in \mathbb{R}[x]$ is a polynomial such that the quoitent of the division of $P(2x)$ by $P(x)$ is $16$. How could we find the quoitent of the division of $P(3x)$ by $P(x)$?
Assume that $P(x) = \sum_{1\leq i\leq n}\alpha_i x^i\in \mathbb{R}[x]$ is our polynomial. Then,
$$\sum_{0\leq i\leq n}2^i\alpha_ix^{i} = \sum_{0\leq i\leq n}2^4\alpha_i x^{i} + R(x)$$
$$R(x) = \sum_{0\leq i\leq n}(2^i-2^4)\alpha_ix^{i}$$
Where $0\leq \deg(R(x))<\deg(P(x))$. The polynomial
$$R(x) = \sum_{0\leq i\leq n}(2^i-2^4)\alpha_ix^{i}$$
has non-vanishing leading coefficient $(2^n-2^4)\alpha_n$, for all $n\geq 0$ except for $n = 4$. In which case, $\deg(P(x)) = 4$.

Consider your first equality. Since the polynomials in LHS and RHS are the same, let $m$ be the dominant coefficient, such that $P(x)=ax^m+bx^{m-1}+\dots$. We have that $P(2x)=a 2^mx^m+\dots$. Hence, by the equality you wrote and that $R(x)$ has a strictly lower degree than $m$, $$a.2^m=a.16 \implies2^m=16 \iff m=4 $$
Then $P(3x)=a3^4x^4+\dots=81ax^4+\dots$ use similar argument in you second equality to find what you are looking for.
