In what base number systems is there a two-digit number with equal digits, the square of which is a four-digit number with equal digits?
Let the digits of the two-digit number (equal) be denoted by $x$, the squares of the digits by $y$, and the base of the number system by $b$. Then $b$ is at least 2, $x$ and $y$ are less than $b$, and none of them are 0. The problem's condition can be written as:

$$
\overline{x x^{2}}=\overline{y y y y}
$$

which is

$$
(x b+x)^{2}=y b^{3}+y b^{2}+y b+y
$$

By factoring and simplifying with $b+1$ (which is not 0),

$$
\begin{gathered}
x^{2}(b+1)^{2}=y b^{2}(b+1)+y(b+1)=y(b+1)\left(b^{2}+1\right) \\
x^{2}(b+1)=y\left(b^{2}+1\right)
\end{gathered}
$$

The left side is divisible by $b+1$, so the right side must be as well. On the right side, we can clearly separate a part that is divisible by $b+1$:

$$
x^{2}(b+1)=y\left(b^{2}-1+2\right)=y(b+1)(b-1)+2 y
$$

Therefore, the right side can only be divisible by $b+1$ if $2 y$ is divisible by it. Also, $0<2 y<2 b$, so it must be that $2 y=b+1$ and from (1),

$$
x^{2}=y(b-1)+1
$$

or multiplying by 2 to eliminate $y$:

$$
2 x^{2}=(b+1)(b-1)+2=b^{2}+1
$$

Thus, $b$ can only be a number that satisfies the equation

$$
b^{2}=2 x^{2}-1
$$

It is easy to see that $x=1, b=1$ satisfies the equation, but it is not a solution to our problem because 1 cannot be the base of a number system, and $x<b$ does not hold. Looking for further solutions, $b$ can only be odd because $b^{2}$ is odd. Thus, $x$ cannot be even either, because $2 x^{2}=b^{2}+1=(2 k+1)^{2}+1=4 k(k+1)+2$, so $x^{2}=2 k(k+1)+1$, which is odd. Trying $x=5$ immediately gives a solution: $b=7$, and from this, $y=4$. Therefore,

$$
\left(55_{7}\right)^{2}=4444_{7}
$$

(In the decimal system, the base is $5 \cdot 7+5=40$, and its square is $4 \cdot 7^{3}+4 \cdot 7^{2}+4 \cdot 7+4=4\left(7^{2}+1\right)(7+1)=1600$, so the result is correct.)

We can obtain an arbitrary number of solutions starting from the solution $x_{0}=1, b_{0}=1$ using the formulas $x_{k+1}=3 x_{k}+2 b_{k}, b_{k+1}=4 x_{k}+3 b_{k}$. If indeed $x_{k}, b_{k}$ is a solution, i.e.,

$$
b_{k}^{2}-2 x_{k}^{2}+1=0
$$

then $x_{k+1}, b_{k+1}$ is also a solution, because

$$
\begin{aligned}
& b_{k+1}^{2}-2 x_{k+1}^{2}+1=16 x_{k}^{2}+24 x_{k} b_{k}+9 b_{k}^{2}-18 x_{k}^{2}-24 x_{k} b_{k}-8 b_{k}^{2}+1= \\
& =b_{k}^{2}-2 x_{k}^{2}+1=0
\end{aligned}
$$

Using the formulas, $x_{1}=3+2=5$ and $b_{1}=4+3=7$; this is what we found by trial. The next solution is $x_{2}=29$, $b_{2}=41$, and $y_{2}=21$.

László Gálfi (Budapest, I. István g. IV. o. t.)

Remark. From (2), eliminating $b$,

$$
x^{2}=2 y^{2}-2 y+1=y^{2}+(y-1)^{2}
$$

Thus, every Pythagorean triple whose legs differ by 1 gives a solution for the digits $x, y$. These can only be primitive triples, because in a non-primitive triple, the difference between the legs is clearly a multiple of the greatest common divisor. However, this observation does not bring us closer to the solution, because if we use the known formula system with the $\sqrt{3}^{3}$ leg formulas,

$$
\left(u^{2}-v^{2}\right)-2 u v= \pm 1, \quad \text { then } \quad(u-v)^{2}=2 v^{2} \pm 1
$$

we again arrive at the equation of type (3), or the one obtained by replacing -1 with +1 in it. [^0]

[^0]:    ${ }^{1}$ See, for example, Pál Erdős and János Surányi: Selected Topics in Number Theory (Budapest, 1960, Tankönyvkiadó) p. 200, 6th section.

    ${ }^{2}$ It is also true, but not easy to prove, that the pairs of numbers $x_{k}, b_{k}$ calculated according to the above relationships give all solutions of (2).

    ${ }^{3}$ See K. M. L. 23 (1961/12) pp. 212-213.