Suppose $p$ is a prime number such that $(p-1)/4$ and $(p+1)/2$ are also primes. Show that $p=13$ 
Suppose $p$ is a prime number such that $(p-1)/4$ and $(p+1)/2$ are also primes. Show that $p=13$.

My approach: 
Since $p$ is prime, it is of the form $6k+1$ or $6k-1$. Now if $p$ is of the form $6k-1$ then $(p+1)/2 = 3k$ which is not possible as $3|3k$. 
So $p$ is of the form $6k+1$. Now $(p-1)/4 = 3k/2$ so $2\mid k$. So $p$ is of the form $12k+1$. But now, how to prove $k=1$?
Please help!
 A: When you check the $p = 6k-1$ case, you say that you get a contradiction as $\frac{1}{2}(p+1) = 3k$ which can't be prime as $3 \mid 3k$. However, your argument is flawed as $k$ could be $1$. However, if $k = 1$, we have $p = 5$ so $\frac{1}{4}(p-1) = 1$ which is not prime. Therefore, as you concluded, $p$ must be of the form $6k+1$.
You have shown that if $p = 6k+1$, we have $\frac{1}{4}(p-1) = \frac{3k}{2}$. For this to be an integer, we need $2 \mid k$ as you've noticed, so $k = 2l$ for some integer $l$. Then, $\frac{1}{4}(p-1) = 3l$. For this to be prime, we need $l = 1$, so $k = 2$, and therefore $p = 13$. Just to recap, if $p$ is a prime of the form $6k+1$ and $\frac{1}{4}(p-1)$ is prime, then $p = 13$ is prime. You should still check that if $p = 13$, then $\frac{1}{2}(p+1)$ is prime.
A: Try $12 k + \cdot$
Now the only possibilities are
$$
12k+1, 12k+5, 12k+7, 12k+11$$
Since $4$ divides $p-1$, only $12k+1$, and $12+5$ are possible
and $(p-1)/4 = 3k \text {or} 3k + 1$.
If $k\ne1$ then $12k+1$ is not possible
Also $(p+1)/2 = 6k+1$ or $6k+3$. This shows that $6k+5$ is not possible.
So $p=12+1 = 13$.
A: Because, since $p=12k+1$ and $\frac{p-1}{4}$ is prime that means $3k$ is prime which only happens if $k=1$
A: Can you show that $3|3k/2$?
Incidentally, you should eliminate the possibilities $p =2, 3$ when you say that $p$ has the form $6k \pm 1$. Also, when you say $3|3k$, you need to eliminate the possibility $k = 1$.
A: Hint(for those who want to see what happens): 
$$q-1=\phi(\frac{p-1}{4})=\frac{p-1}{4}-1=\frac{p-5}{4}$$
$$s-1=\phi(\frac{p+1}{2})=\frac{p+1}{2}-1=\frac{p-1}{2}$$
(Where $q-1=\phi(q)=\phi(\frac{p-1}{4})$ and $s-1=\phi(s)=\phi(\frac{p+1}{2})$)
