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

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.


Because, since $p=12k+1$ and $\frac{p-1}{4}$ is prime that means $3k$ is prime which only happens if $k=1$