47. Find all positive integers $p(\geqslant 2)$, such that there exists $k \in \mathbf{N}^{*}$, satisfying: the number $4 k^{2}$ in base $p$ representation consists only of the digit 1.
47. It can be proven that the positive integers $p \in \{3,7\}$ satisfy the condition.

When $p=3$, taking $k=1$ is sufficient. When $p=7$, taking $k=10$, we have $4 k^{2}=400=(1111)_7$. Therefore, when $p \in \{3,7\}$, the condition is satisfied.

On the other hand, let $p$ be a positive integer that satisfies the condition. The problem is equivalent to finding all $p \in \mathbf{N}^{*}$ such that the equation
$$4 k^{2}=(\underbrace{11 \cdots 1}_{n \uparrow})_{p}=1+p+\cdots+p^{n-1}=\frac{p^{n}-1}{p-1}$$
has positive integer solutions $(k, n)$.
From (12), we know that $p$ is odd (otherwise, $1+p+\cdots+p^{n-1}$ is odd, and (12) cannot hold). Furthermore, $1+p+\cdots+p^{n-1}$ is the sum of $n$ odd numbers, so $n$ is even. Let $n=2^{a} \cdot q, \alpha \in \mathbf{N}^{*}, q$ be an odd number, then from (12) we have
$$\begin{aligned}
4 k^{2} & =\frac{p^{n}-1}{p-1} \\
& =\left(\frac{p^{q}-1}{p-1}\right)\left(p^{q}+1\right)\left(p^{2 q}+1\right) \cdot \cdots \cdot\left(p^{2^{\alpha-1} q}+1\right)
\end{aligned}$$

Notice that $\frac{p^{q}-1}{p-1}=1+p+\cdots+p^{q-1}$ is the sum of $q$ odd numbers, so $\frac{p^{q}-1}{p-1}$ is odd. For any $0 \leqslant \beta \leqslant \alpha-1$, we have
$$\left(p^{q}-1, p^{2^{\beta} q}+1\right)=\left(p^{q}-1,\left(p^{q}\right)^{2^{\beta}}-1+2\right)=\left(p^{q}-1,2\right)=2,$$

hence $\left(\frac{p^{q}-1}{p-1}, p^{2^{\beta} q}+1\right)=1$.
Furthermore, for $1 \leqslant \beta \leqslant \alpha-1$ (if such $\beta$ exists), we have
$$\left(p^{q}+1, p^{2^{\beta} q}+1\right)=\left(p^{q}+1,(-1)^{2^{\beta}}+1\right)=\left(p^{q}+1,2\right)=2 .$$

Using these conclusions and (13), we know there exists $a \in \mathbf{N}^{*},(a \mid k)$, such that $p^{q}+1=4 a^{2}$ or $p^{q}+1=2 a^{2}$.

If the former holds, then $p^{q}=4 a^{2}-1=(2 a-1)(2 a+1)$, and $(2 a-1,2 a+1)=1$, so $2 a-1$ and $2 a+1$ are both $q$-th powers. Let $2 a-1=x^{q}, 2 a+1=y^{q}, x y=p$, $(x, y)=1$, then $x<1$. Considering $p^{2 q}+1$, note that $p^{q}+1$, $p^{2 q}+1, \cdots, p^{2^{\alpha-1} q}+1$ have pairwise greatest common divisors of 2. Combining (13) and $p^{2 q}+1 \equiv 2(\bmod 4)$, we know there exists $b \in \mathbf{N}^{*}$ such that $p^{2 q}+1=2 b^{2}$. Combining $p^{q}+1=2 a^{2}$, we get
$$2 a^{4}-2 a^{2}+1=b^{2}$$

We now solve (14) for positive integer solutions.
$$(14) \Leftrightarrow\left(a^{2}-1\right)^{2}+\left(a^{2}\right)^{2}=b^{2}$$

Since $\left(a^{2}-1, a^{2}\right)=1$, by the structure of primitive Pythagorean triples, we have
$$\text { (I) }\left\{\begin{array} { l } 
{ a ^ { 2 } - 1 = c ^ { 2 } - d ^ { 2 } , } \\
{ a ^ { 2 } = 2 c d , } \\
{ b = c ^ { 2 } + d ^ { 2 } , }
\end{array} \text { or (II) } \left\{\begin{array}{l}
a^{2}-1=2 c d, \\
a^{2}=c^{2}-d^{2}, \\
b=c^{2}+d^{2},
\end{array}\right.\right.$$
where $c, d \in \mathbf{N}^{*}, c, d$ are of different parities, and $(c, d)=1$.
For case (I), $a$ is even. Combining $a^{2}-1=c^{2}-d^{2}$, taking $\bmod 4$ on both sides, we find $c$ is even and $d$ is odd. From $a^{2}=2 c d$ and $(c, d)=1$, we know there exist $x, y \in \mathbf{N}^{*}$ such that $(c, d, a)=\left(2 x^{2}, y^{2}, 2 x y\right)$, where $(x, y)=1$ and $y$ is odd. Substituting back into $a^{2}-1=c^{2}-d^{2}$, we get
$$4 x^{2} y^{2}-1=4 x^{4}-y^{4} \Leftrightarrow\left(y^{2}+2 x^{2}\right)^{2}-8 x^{4}=1$$
The positive integer solutions to (15) are only $\left(y^{2}+2 x^{2}, x\right)=(3,1)$ (see Exercise 4, Question 25) $\Rightarrow$ $x=y=1 \Rightarrow a=2, b=5 \Rightarrow p=7, q=1$.

For case (II), $a$ is odd. Using $a^{2}=c^{2}-d^{2}$, i.e., $a^{2}+d^{2}=c^{2}$ and $(c, d)=1$, we know there exist $x, y \in \mathbf{N}^{*}, (x, y)=1$, $x, y$ of different parities, such that $(a, d, c)=\left(x^{2}-y^{2}, 2 x y, x^{2}+y^{2}\right)$. Substituting into $a^{2}-1=2 c d$, we get
$$\begin{array}{c}
x^{4}-2 x^{2} y^{2}+y^{4}-1=4 x y\left(x^{2}+y^{2}\right), \\
(x-y)^{4}-8(x y)^{2}=1,
\end{array}$$
where $x>y$, so we need (16) to have positive integer solutions. However, (16) has no positive integer solutions (similar to the proof in Exercise 4, Question 25), so there are no positive integers $a, b$ that satisfy (II).