<s>[INST] Find all integer polynomials $f(p)$ that divide $2^p–2$ for every prime $p>2$ Find all polynomials $f(p)$ with integer coefficients that divide $2^p–2$ for every prime $p>2$
From Fermat's little theorem we can find $2p, p, -2p, -p$ (and per comments, some constant polynomials). But are there others, or can we prove higher degrees won't work?
 [/INST] $(p-1)$ is even, let $p-1=2k$, we can write:
$2^p-2=2(2^{p-1}-1)=2(2^k-1)(2^k+1)=2(2^{\frac{p-1}{2}}-1)(2^{\frac{p-1}{2}}+1)$
If $k=\frac{p-1}2=2m+1$ is odd we have:
$m=\frac{p-3}2$
Then:
$2^k-1=(2-1)(2^{2m}+2^{2m-1}+2^{2m-2}+ \cdot\cdot\cdot)=(2^{p-3}+2^{p-4}+2^{p-5}\cdot \cdot \cdot)$
Also:
$2^k+1=(2+1)(2^{2m}-2^{2m-1}+2^{2m-2}-2^{2m-3} \cdot\cdot\cdot)=3(2^{p-3}-2^{p-4}+2^{p-5}-2^{p-7}\cdot \cdot \cdot)$
Hence the factors of $2^p-2$ can at most be  ±2,  ±p,3,$A=(2^{p-3}+2^{p-4}+2^{p-5}\cdot \cdot \cdot)$ and $B=(2^{p-3}-2^{p-4}+2^{p-5}-2^{p-7}\cdot \cdot \cdot)$.
Now we construct an equation it's roots are these factors:
$[x-(2^n-2)](x±2)(x±p)(x-3)(x-A)(x-B)=0$
We can rewrite this equation as:
$f(x,p)=(±2)(3)(±p)(2^n-2)\cdot A\cdot B$
RHS of this equation divides $2^p-2$, therefore polynomial $f(x, p)$, on LHS divides it.
</s>