Polynomials equations and division
Algebra · proposed by @vipproaccount
Find the sum of all positive integers $n\leq 2027$ for which there exist non-constant polynomials $f_1(x)$, $f_2(x)$, $\dots$, $f_n(x)$, $g(x)$ with integer coefficients (the $f_i$ need not be distinct) such that
• $x^2+1$ divides $g(x)$, and
• $\displaystyle\prod_{i=1}^{n}\bigl(f_i(x)^2-1\bigr) = g(x)^2-1,\quad \forall x\in\mathbb{R}$