## Task 25/69

For which whole, positive numbers $n$ is the number $2^{n} \pm 1$ the square of a whole number?
We distinguish the two cases $2^{n}+1$ and $2^{n}-1$.

1. Let $z=2^{n}+1$ be a square number. Then $z=2^{n}+1=q^{2}$, so $2^{n}=q^{2}-1=(q+1)(q-1)$. Thus, $q+1=2^{\nu} ; q-1=2^{\mu}$ with $\nu>\mu, \nu+\mu=n$.

By subtraction, we obtain

$$
2^{\nu}-2^{\mu}=2 ; \quad 2^{\nu-1}-2^{\mu-1}=2^{\nu-1}-2^{n-\nu-1}=1
$$

The only powers of 2 that differ by 1 are $2^{1}$ and $2^{0}$. Therefore, $\nu-1=1, \mu-1=n-\nu-1=0$ so $\nu=2, n=3$. Indeed, $2^{3}+1=8+1=9=3^{2}$.

2. Let $z=2^{n}-1$ be a square number. Clearly, this is the case for $n=1$: $2^{1}-1=1=1^{2}$. We assume $n>1$ in the following.

For every $n>1$, $2^{n}$ leaves a remainder of 0 when divided by 4. Thus, $2^{n}-1$ leaves a remainder of 3 when divided by 4. However, every square number leaves a remainder of 0 or 1 when divided by 4, as can be seen from $(2 k)^{2}=4 k^{2}$ and $(2 k+1)^{2}=4 k^{2}+4 k+1$. Therefore, the assumption for $n>1$ is false.

Thus, there are only two square numbers of the form $2^{n} \pm 1$, namely for $n=3$ (plus sign) and for $n=1$ (minus sign).