Prove that the prime $p$ can only be $13$ Given that $p$ is a prime such that both $\frac{p-1}{4}$ and $\frac{p+1}{2}$ are also primes.Then prove that $p=13$.
My try:
Let $p_1,p_2$ be primes such that
$$\frac{p-1}{4}=p_1$$ and
$$\frac{p+1}{2}=p_2$$
So we get,
$$p=4p_1+1=2p_2-1$$
Now if i start keeping values ofcourse i am getting $p_1=3,p_2=7,p=13$ as the only prime triplets. But is there a formal way to prove $13$ is the only value of $p$.
 A: You have
$$\begin{equation}\begin{aligned}
4p_1 + 1 & = 2p_2 - 1 \\
4p_1 & = 2p_2 - 2 \\
2p_1 & = p_2 - 1 \\
p_2 & = 2p_1 + 1
\end{aligned}\end{equation}\tag{1}\label{eq1A}$$
With $p_1$, consider its possible values modulo $3$. If it's $p_1 \equiv 1 \pmod{3}$, then $p_2 \equiv 0 \pmod{3}$, which is not allowed since $p_2 \gt 3$. Alternately, if $p_1 \equiv 2 \pmod{3}$, then $p_2 \equiv 2 \pmod{3}$ so $p = 2p_2 - 1 \implies p \equiv 0 \pmod{3}$. The only case where this may be possible is where $p_2 = 2$ giving $p = 3$, but then $p = 4p_1 + 1$ can't hold. This leaves the only possible case where $p_1$, $p_2$ and $p$ are all prime is where $p_1 = 3$, leading to your one case where $p = 13$.
A: Suppose $p\equiv1\bmod3$, then it is easy to verify that $\frac{p-1}4\equiv0\bmod3$, so $\frac{p-1}4=3$ and $p=13$.
Suppose $p\equiv2\bmod3$, then by similar logic $\frac{p+1}2\equiv0\bmod3$ and $p=7$, but then $\frac{p-1}4$ is non-integral.
Since $p>3$ by $\frac{p-1}4$ being prime, $p=13$.
A: Çlearly, $(p-1)/4\ne2,(p-1)/4\ge3\iff p\ge13$
So, if $(p-1)/4>3,$
Either $(p-1)/4=6k+1,k\ge1$
$(p+1)/2=12k+3=3(4k+1)$
Or $(p-1)/4=6k-1,k\ge1,p=?$
