a) Let's find all natural numbers such that by replacing each digit in their square with a digit that is $d$ less, we get the square of a natural number that is $d$ less than the original number.

b) How many solutions does the problem have in an arbitrary base number system?
a) Let the sought number be $x$, the number $d$ less than it be $y$, and the number of digits in $x^{2}$ be $k$. We denote the number written with $k$ ones as $C$. According to the problem,

$$
x^{2}-y^{2}=d \cdot C, \quad(1) \quad x-y=d
$$

On the left side, $x^{2}-y^{2}=(x-y) \cdot(x+y)=d(x+y)$, so $d(x+y)=d \cdot C$, and dividing by $d$ (since $d>0$),

$$
x+y=C
$$

Since $x>y$, $2 x>C$, thus $4 x^{2}>C^{2}$. However, $x^{2}$ and $C$ have $k$ digits, so $C \geqq 10^{k-1}, C^{2} \geqq 102^{k-2}$, and $10 k>x^{2}$, thus

$$
4 \cdot 10^{k}>4 x^{2}>C^{2} \geqq 10^{2 k-2}
$$

From the inequality of the two extreme terms, $4>10^{k-2}$, which implies $k \leqq 2$. However, $k$ cannot be 1, because $C=x+y>1$, so $k=2, C=11$, and $x^{2}$ is a two-digit number, thus $x$ is a single-digit number. Since $x+y=11$, $10>x>y$, and considering (2), the possible values for $x, y$, and $d$ are:

$$
\begin{array}{lllll}
\mathrm{x}= & 6, & 7, & 8, & 9 \\
\mathrm{y}= & 5, & 4, & 3, & 2, \\
\mathrm{~d}= & 1, & 3, & 5, & 7 .
\end{array}
$$

With these,

$$
\begin{array}{ccccc}
x^{2}= & 36, & 49, & 64, & 81, \\
y^{2}= & 25, & 16, & 9, & 4
\end{array}
$$

In the third and fourth value systems, the second digit of $x^{2}$ is smaller than $d$, so these are not solutions to the problem. The first two value systems satisfy all the requirements of the problem, so the sought numbers are 6 and 7.

b) Let the base of the number system be $a$. We can adopt part of the previous reasoning, considering multi-digit numbers in the $a$-based number system. (1), (2), and (3) remain valid, and the inequality $4>10^{k-2}=(1 \cdot a+0)^{k-2}$ also remains valid, so

$$
a^{k-2}<4
$$

Since $C=x+y>1$ still holds, $k$ cannot be 1. $a$ cannot be 2 or 3. The digit $d$ is less than $a-1$, because otherwise, subtracting a number with the same number of $a-1$ digits from $x^{2}$ cannot yield a positive remainder. There is no positive $d$ if $a=2$; if $a=3$, $d$ can only be 1. In this case, from (3) and (2),

$$
x=\frac{C+d}{2}
$$

$C$ is odd, so $k$ cannot be 2, thus from (4), $k=3$, so $x=7$, and $7^{2}$ in the 3-based number system is more than 3 digits.

For every base $a \geqq 4$, from (4), $k \leqq 2$, so $k=2, C=a+1$ and $x^{2}$ is a two-digit number, thus $x^{2}y$ and $y$ can take values $2,3,4, \ldots, a_{0}$, where $a_{0}$ is the largest integer for which $a_{0}<\frac{a}{2}$, because

$$
x^{2}>\frac{a^{2}}{a} \geqq a
$$

The triples $x, y, d$ are solutions to our problem if each digit of $x^{2}$ is individually greater than the corresponding digit of $y^{2}$ by $d$. If this condition is met for the second digits, or

$$
x^{2}=y^{2} d C=y^{2}+(d+a d)
$$

when the addition is performed digit by digit (first adding the $d$, then the $a d$ term), the first digit of $y^{2}+d$ is the same as the first digit of $y^{2}$, then the condition is also met for the first digits. Thus, there is no carry-over, the $a d$ term increases the digit of $y^{2}$ with place value $a$ by $d$, and gives the first digit of $x^{2}$, because there cannot be a carry-over here, since $x^{2}<a^{2}$. The number of solutions to the problem is equal to the first digit of $a_{0}^{2}$, which is given by the integer part of the quotient $a_{0}^{2}: a$, so the number of solutions is

$$
\left[\frac{1}{a} a_{0}^{2}\right]=\left[\frac{1}{a}\left[\frac{a}{2}\right]^{2}\right]
$$

Our result matches the result obtained in part (a), since for $a=10$, $a_{0}=5$, and the first digit of $a_{0}^{2}$ is 2.