HMMT-Nov 2015 guts, Problem 15

Find the smallest positive integer $b$ such that $1111_{b}$ (1111 in base $b$ ) is a perfect square. If no such $b$ exists, write "No solution".

Solution: We have $1111_{b}=b^{3}+b^{2}+b+1=\left(b^{2}+1\right)(b+1)$. Note that $\operatorname{gcd}\left(b^{2}+1, b+1\right)=\operatorname{gcd}\left(b^{2}+1-(b+1)(b-\right.$ $1), b+1)=\operatorname{gcd}(2, b+1)$, which is either 1 or 2 . If the gcd is 1 , then there is no solution as this implies $b^{2}+1$ is a perfect square, which is impossible for positive $b$. Hence the gcd is 2 , and $b^{2}+1, b+1$ are both twice perfect squares. Let $b+1=2 a^{2}$. Then $b^{2}+1=\left(2 a^{2}-1\right)^{2}+1=4 a^{4}-4 a^{2}+2=2\left(2 a^{4}-2 a^{2}+1\right)$, so $2 a^{4}-2 a^{2}+1=$ $\left(a^{2}-1\right)^{2}+\left(a^{2}\right)^{2}$ must be a perfect square. This first occurs when $a^{2}-1=3, a^{2}=4 \Longrightarrow a=2$, and thus $b=7$. Indeed, $1111_{7}=20^{2}$. $\fbox{7}$.

Answer: 7