The positive integers $p$, $q$ are such that for each real number $x$ $(x+1)^p (x-3)^q=x^n+a_1 x^{n-1}+a_2 x^{n-2}+\dots +a_{n-1} x+a_n$ where $n=p+q$ and $a_1,\dots ,a_n$ are real numbers. Prove that there exists infinitely many pairs $(p,q)$ for which $a_1=a_2$.
Problem
Source: XI International Festival of Young Mathematicians Sozopol 2022, Theme for 11-12 grade
Tags: algebra