4. Find all prime numbers $p$ not exceeding 1000 such that $2p+1$ is a perfect power (i.e., there exist natural numbers $m, n, n \geqslant 2$, such that $2p+1=m^n$).
4. Solution: If $2 p+1$ is a power of a natural number, i.e., $2 p+1=m^{n}$,

then $m$ is an odd number. Let $m=2 k+1$, then we have
$$
2 p+1=(2 k+1)^{n} \text {, }
$$

thus $2 p=2 k \cdot A$, where $p$ is a prime number, and $A$ is an integer greater than 1.
That is, $p=k \cdot A$,
Since $p$ is a prime number, it follows that $k=1$, hence $m=3$.
Thus, $2 p+1=3^{n}$,
Given $p \leqslant 1000$, then $3^{n} \leqslant 2001$,
The powers of 3 not exceeding 2001 are $3, 3^{2}, 3^{3}, 3^{4}, 3^{5}, 3^{6}$. Substituting these into equation (1) one by one, we find that only $2 p+1=3^{3}$ makes $p$ a prime number.
At this point, $p=13$.
Thus, the only prime number that satisfies the condition is 1, $p=13$.