Problem

Source: Dutch BxMO TST 2019 p1

Tags: number theory



Prove that for each positive integer $n$ there are at most two pairs $(a, b)$ of positive integers with following two properties: (i) $a^2 + b = n$, (ii) $a+b$ is a power of two, i.e. there is an integer $k \ge 0$ such that $a+b = 2^k$.