197. Find all natural numbers $n$ and $k$ such that $n^{n}$ has $k$ digits, and $k^{k}$ has $n$ digits.
197. Answer: $n=k$ and $k=1,8$ or 9.

If $n^{n}$ has $k$ digits, and $k^{k}$ has $n$ digits, then $10^{k-1} \leqslant n^{n}<10^{4}$ and $10^{n-1} \leqslant k^{k}<10^{n}$. Let, for definiteness, $n \geqslant k$. Then $n^{n}<10^{n}$, i.e., $n<10$ and $k<10$. It remains to check that $2^{2}<$ $<10,3^{3}<100,4^{4}<10^{3}, 5^{5}<10^{4}, 6^{6}<10^{5}, 7^{7}<10^{6}, 10^{7}<$ $<8^{8}<10^{8}, 10^{8}<9^{9}<10^{9}$.