Let $P(x)$ and $Q(x)$ be polynomials of degree $p$ and $q$ respectively such that every coefficient is $1$ or $2023$. If $P(x)$ divides $Q(x)$, prove that $p+1$ divides $q+1$.
Source: 2023 Indonesia TST Stage 1: Test 4 - Number Theory
Tags: number theory, polynomial
Let $P(x)$ and $Q(x)$ be polynomials of degree $p$ and $q$ respectively such that every coefficient is $1$ or $2023$. If $P(x)$ divides $Q(x)$, prove that $p+1$ divides $q+1$.