4. If $x$ is a four-digit integer in decimal notation, let the product of the digits of $x$ be $T(x)$, the sum of the digits be $S(x)$, $p$ be a prime number, and $T(x)=p^{k}, S(x)=p^{p}-5$, then the smallest $x$ is $\qquad$ .
4. 1399 .

Solution: Let these 4 digits be $a, b, c, d$. It is easy to see that $p=3, S(x)$ $=a+b+c+d=22$, and from $T(x)=3^{k}$ we know that $a, b, c, d$ are multiples of 3 or 1. It can be verified that 1399 is the smallest integer that satisfies the conditions.