Let f(x)=x2+bx+p be a quadratic with leading coefficient 1, f(0)=p=0, and f(1)=31.
From f(1)=1+b+p=31, we get b+p=−32.
If α is a common root of f(x)=0 and f∘f∘f∘f(x)=0, then since f(α)=0:
f(f(α))=f(0)=p
f(f(f(α)))=f(p)=p2+bp+p
f(f(f(f(α))))=f(p2+bp+p)=0
So p2+bp+p must be a root of f(x)=0.
Note that p2+bp+p=p(p+b+1)=p⋅31=3p.
Since 3p is a root of f, we have
f(3p)=9p2+3bp+p=0
Dividing by p=0 gives 9p+3b+1=0, hence p+3b+9=0.
Solving the system b+p=−32 and p+3b=−9: subtracting gives 2b=−9+32=−325, so b=−625. Then p=−32+625=621=27.
Finally, compute f(−3):
f(−3)=9+(−625)(−3)+27=9+225+27=9+16=25
The answer is 25.