# Repeated digits of squares in different bases

Hello, I am Mahima. I would like to ask the following clarifications. If any one answered, I am so thankful to you.

In which bases is 1111 a square? b^3 + b^2 + b + 1 = n^2. (b + 1)(b^2 + 1) = n^2. We look at the gcd(b+1, b^2 +1) using the Euclidean algorithm. And find that gcd(b+1, b^2 +1) = 2 if b is odd, but 1 if b is even. If b is even, we have both (b + 1) and (b^2 + 1) a square. But that is not possible as no positive squares differ by 1. So b is odd, and both b + 1 and b^2 + 1 are even, so they are both twice a square. So we have: b + 1 = 2a^2 and b^2 + 1 = 2c^2.

These are simultaneous diophantine equations. We solve the one with least solutions and test these with the easier one. The second is a Pellian equation. The smallest solution is b = 7, c = 5. This also satisfies the first. So we have one solution. base 7 1111 = 1 + 7 + 7^2 + 7^3 = 20^2. Using the method for solving the Pellian, I can't find another solution for both equations. I may be able to produce a proof by induction that the solution is unique. I have had a look at base 12, and think it might be a limited base. Please see what you can do there.

I want generalizations also. Thanks in advance. with LOVE, Mahima.

An elementary solution of this case is possible, as you noted it comes down to solving $b+1=2a^2$ and $b^2+1=2c^2$. This implies $$(b^2-1)^2+b^4=c^2$$ and you basically have to prove that the only Pythagorean triple of the form $(x^2-1,x^2,y)$ is $(3,4,5)$. Now this is not so hard, you can proceed by using the parametric solutions to Pythagoras's equation. You might need to use the fact that an equation of the form $x^4\pm y^4=z^2$ has only trivial solutions, and the proofs of these are by contradiction, similar to Fermat's last theorem for the exponent 4. All of this can be found in elementary number theory books.
Now for the generalization, it has been proven that the only solutions to $$1+x+\cdots+x^{n-1}=y^2$$ are $(x,y,n)=(7,\pm 20, 4)$ and $(3,\pm 11, 5)$. (W . Ljunggren, "Noen setninger om ubestente likninger av formen $\frac {x^n - 1} {x-1} = y^q$," Norsk. Mat. Todsskr. (1943), p.17-20)
Your equation $n^2=(b+1)(b^2+1)$ defines an elliptic curve. By Siegel's theorem http://en.wikipedia.org/wiki/Siegel%27s_theorem_on_integral_points the set of integer solutions will be finite. Mordell's theorem http://en.wikipedia.org/wiki/Mordell%E2%80%93Weil_theorem shows that the set of rational solutions has a structure as a finitely generated Abelian group. There are methods, described in texts on elliptic curves, which usually determine the structure of these groups. Various packages including SAGE http://www.sagemath.org/ implement these. If you are lucky you may find there are only finitely many rational solutions to your equation. You may be less lucky and find that there are infinitely many, but still be able to find all integer solutions.