Integer between the primes p and p+2 is a perfect square. Explain why there exists an integer $n$ such that $4n^2 − 1 = p$

(a) If $p=2$ then $p+2=4$ is not prime, i.e. we can be sure that the two primes $p$ and $p+2$ are odd.

(b) If $p+1=n^2$ with positive integer $n$, then $p=n^2-1=(n+1)(n-1)$ is a factorisation of $p$. Conclude that $n-1=1$, i.e., $p=3$

It turns out that in the only possible case, the number between 3 an 5 is also of the form $4n^2$.


(b) is straightforward: $p + 1$ can be written as $x ^ 2$, so $p \ne \pm 2$ otherwise that perfect square couldn't be written as $(2n)^2$. As you said $p + 1 = 4n^2$, subtract $1$ from bot sides: $p = 4n^2 - 1$.

(c) As @lulu said $2n - 1 = 1 \Rightarrow n = 1 \Rightarrow 4n^2 - 1 = 3$