The integers $a$ and $b$ have the property for every nonnegative integer $n$ the number of $2^na +b$ is the square of an integer. Show that $a = 0$.

The integers $a$ and $b$ have the property that for every nonnegative integer $n$ the number of $2^na +b$ is the square of an integer. Show that $a = 0$.

I have been trying to show that if $2a+b$ is a perfect square then $4a+b$ or $8a+b$ isn't. Am I going the wrong way? Could you give some hints to proceed with? Do you have any ideas on how to proceed with this question?

Assume that such integer $a,b$ exists that $a \neq 0$.

Let $$2^na+b=x^2,2^{n+2}a+b=y^2,$$ then $$4x^2-y^2=(2x+y)(2x-y)=3b\Rightarrow2x+y\le 3b.$$ But for sufficiently large $n$ sum $2x+y$ not bounded if $a \neq 0$. Contradiction.

Thus, we have $a=0$.

We can finish a little differently: since we can take a couple different pairs $(x, y)$, then the number $3b$ infinite number of ways represented as the difference of two squares. However, such natural numbers does not exist, since each number n is resolved into two factors is not more than $\sqrt n$ means.
• I didn't understand what you meant by But for sufficiently large $n$ sum $2x+y$ not bounded if $a \neq 0$. Contradiction. – TheRandomGuy Mar 20 '16 at 17:29
• $a,b$ can be any integers, not just non-negative integers. If $b$ is negative and wlog $x,y\ge 0$, then $2x+y>3b$. – user236182 Mar 20 '16 at 18:36
• @Roman83 So you basically mean that for some value of $n$, $2x+y$ will be bigger than $3b$? I understand the exception when $a=0$ but I still don't believe 'for sufficiently large $n$'. – TheRandomGuy Mar 21 '16 at 7:08
• As I said, this is not a fully correct answer. If $b$ were a positive integer, then (2x+y)(2x-y)=3b$would imply$2x+y\le 3b$, but$b\$ can be any integer. See my other comment. – user236182 Mar 21 '16 at 9:00