B2. Find all natural numbers $n$ and prime numbers $p$ for which $\sqrt{n}+\frac{p}{\sqrt{n}}$ is a square of a natural number.
B2. Let $\sqrt{n}+\frac{p}{\sqrt{n}}=k^{2}$, where $k$ is a natural number. Squaring the equation, we get $n+2 p+\frac{p^{2}}{n}=k^{4}$. From this, it follows that $n$ divides $p^{2}$. Since $p$ is a prime number, $n$ must be $1, n=p$ or $n=p^{2}$. If $n=p$, we get the equation $p+2 p+p=k^{4}$ or $4 p=k^{4}$. From this, it follows that $k$ must be even and therefore $p$ must be divisible by 4, which is impossible. If $n=1$ or $n=p^{2}$, we get the equation $1+2 p+p^{2}=k^{4}$ or $1+p=k^{2}$, thus $p=(k-1)(k+1)$. From this, it follows that $k=2$, so $p=3$. We get the solutions $n=1, p=3$ and $n=9, p=3$.
Squaring the initial equation ..... 1 point
Determining that $n$ divides $p^{2}$ ..... 1 point
Listing all three possibilities for $n$ ..... 1 point
Concluding that $n$ cannot be equal to $p$ ..... 1 point
Writing the equation $p=(k-1)(k+1)$ for $n=1$ or $n=p^{2}$ ..... 1 point
Writing both solutions ..... 1 point
(If the contestant only writes both solutions, award 1 point.)

2. method. Let $\sqrt{n}+\frac{p}{\sqrt{n}}=k^{2}$, where $k$ is a natural number. Multiplying the equation by $\sqrt{n}$, we get $n+p=k^{2} \sqrt{n}$. From this, it follows that $n$ must be the square of a natural number. Substituting $n=m^{2}$, where $m$ is a natural number, into the initial equation, we get $m+\frac{p}{m}=k^{2}$.
From this, it follows that $m$ divides $p$. Since $p$ is a prime number, $m$ must be $1$ or $m=p$. In both cases, we get the equation $1+p=k^{2}$, thus $p=(k-1)(k+1)$. From this, it follows that $k=2$, so $p=3$. We get the solutions $n=1, p=3$ and $n=9, p=3$.
Multiplying the equation $\sqrt{n}+\frac{p}{\sqrt{n}}=k^{2}$ by $\sqrt{n}$ ..... 1 point
Determining that $n=m^{2}$ ..... 1 point
Writing the equation $m+\frac{p}{m}=k^{2}$ ..... 1 point
Determining that $m$ divides $p$ ..... 1 point
Listing both possibilities for $m$ ..... 1 point
Writing both solutions ..... 1 point
(If the contestant only writes both solutions, award 1 point.)