Can $10101\dots1$ be a perfect square in any base?

Solution 1:

Just some ideas, too long for comments.

Summary: No such square exists if either $b$ or $k$ is even.

This can be written as $(b^k)^2-(b^2-1)y^2=1$.

The set of positive integer solutions to the Pell equation $x^2-(b^2-1)y^2=1$ are exactly the values:

$$x+y\sqrt{b^2-1}=\left(b+\sqrt{b^2-1}\right)^n; n\in\mathbb Z^{+}$$

So you need to show that $x$ is a power of $b$ only when $n=1$.

There is a recurrence: $x_0=1,x_1=b, x_{n+1}=2bx_n-x_{n-1}$.

This gives $x_2=2b^2-1, x_3=4b^3-3b=b(4b^2-3)$. There is no $b$ (other than $1$) which makes $x_3$ a power of $b$.

We can show that $x_{2n}\equiv (-1)^n\pmod {b^2}$ and $x_{2n+1}\equiv (-1)^{n}b(2n+1)\pmod{b^3}$.

So $x_{2n}$ is never a power of $b$, and if $x_{2n+1}$ is a non-trivial power of $b$, then $2n+1$ is divisible by $b^2$.

In particular, you can't have $b$ even.

You can prove inductively that $x_k>b^{k}$ for $k>1$, so the number of digits base $b$ must be at least $b$.

We also get that $x_{m}\equiv (-1)^m\pmod{b+1}$. Then if $x_{2n+1}=b^k$ then $$b^{k}+1\equiv 0\pmod{b+1}$$ and thus $k$ must be odd.

Now, from $y^2=1+b^2+b^4+\cdots +b^{2(k-1)}$ you get that $y^2\equiv k\pmod{b^2-1}$. Since $b$ is odd, you have $8\mid b^2-1$ and since $k$ is odd, we must have that $k\equiv 1\pmod{8}$.


Aside: Actually, $x_n=T_n(b)$ where $T_n$ are the Chebyshev polynomials of the first kind. This might be helpful, not sure. So we are seeking $b,m,k$ so that $T_m(b)=b^k.$

We know that $b,m$ must be odd, $b^2\mid m$, and $k$ must be odd and a square modulo $b^2-1$.

We also have $b^{m}<T_m(b)<2^mb^m$ so $m<k<m(1+\log_b 2)$.

For instance, this means that the smallest $k$ to check for $b=3$ is $k=33,41,49,57.\dots$.

For $b=5$ the smallest candidates for $k$ are: $k=33,81,97,105,\dots.$

For $b=7$, the smallest candidates are $k=57,153,169,177,\dots$.


If $f(x)=1+x+x^2+\cdots +x^{k-1}$ where $k$ is odd, then:

$$f(x)(1-x)+f(-x)(1+x)=2$$

Also, $f(x)f(-x)=\frac{x^{2k}-1}{x^2-1}$, and, again because $k$ is odd, $f(b)$ is odd for any $b$.

This means that $f(b)$ and $f(-b)$ must both be squares.

That means you need $(111\dots1)_b$ a square and $((b-1)0(b-1)0\dots (b-1)01)_b$ to be perfect squares.