Find all positive integers $n$ such that $n \times 2^{n}+1$ is a square.
Solution
Let $a>0$ be an integer such that $n \times 2^{n}+1=a^{2}$. It follows that $2^{n} n=(a-1)(a+1)$. The integers $a-1$ and $a+1$ have the same parity and their product is even, so both must be even. Moreover, since $a-1$ and $a+1$ are consecutive even integers, one of them is twice an odd number, so the other divisible by $2^{n-1}$.
Thus $a+1 \geq 2^{n-1}$ which means $a-1 \leq 2 n$. This implies that $2 n+2 \geq a+1 \geq 2^{n-1}$.
We claim that this false for $n \geq 5$, so we only need to check $n=1,2,3$ and 4 .
When $n=5$, we have $12=2 n+2<2^{n-1}=16$, so the claim holds for $n=5$.
If we know that $2 k+2<2^{k-1}$ for some positive $k$, we can consider:
$$
2(k+1)+2=(2 k+2) \times \frac{k+2}{k+1}<2^{k-1} \times \frac{k+2}{k+1}<2^{k-1} \times 2=2^{(k+1)-1}
$$
so if the claim holds for $k$, it holds for $k+1$.
Checking $n=1,2,3$ and 4 , we find that the values of $n \times 2^{n}+1$ are $3,9,25$ and 65 respectively. Hence $n=2$ and $n=3$ work and $n=1,4$ do not.