TITLE: When is $(a^2+b)(b^2+a)$ a power of $2$?
QUESTION [10 upvotes]: When is $(a^2+b)(b^2+a)$ a power of $2$? 
($a$, $b$ positive integers)
I tried some values on the computer and it seems the only solutions are $a=1$, $b=1$. But I am not sure how to prove it?
Thanks for any help.

REPLY [11 votes]: The product $(a^2+b)(a+b^2)$ is a power of two if and only if both factors are:
$$\begin{array}{rcl}
a^2+b&=&2^r\\
a+b^2&=&2^s
\end{array}$$
If $a=b$, then the equation $a^2+a=a(a+1)=2^r$ has only one solution, namely, $a=1$. So we can WLOG assume that $a>b$. Thus, $r>s$.
Since $2^s=a^2+b\geq2^2+1$, we have that $s>1$.
Since $s>1$, $a$ and $b$ have the same parity. Substracting the equations and factoring we have:
$$(a-b)(a+b-1)=2^s(2^{r-s}-1)$$
Since $a+b-1$ is odd, $2^s$ divides $a-b$, that is, $a=2^sk+b$, $k\geq1$. But $a=2^s-b^2<2^s$, a contradiction.