Let $p$ be an integer greater than 3, and consider the remainder when you divide $p$ by 6. If the remainder is 0, 2 or 4, then $p$ is divisible by 2, and so isn't prime; if the remainder is 3, then $p$ is divisible by 3, and so isn't prime.
Therefore, if $p$ is prime, it must have a remainder of 1 or 5 when divided by 6.
If $p$ and $q$ are primes with $q=p+2$, the only way to arrange the remainders is for $p$ to have a remainder of 5 and $q$ to have a remainder of 1 when divided by 6; then $p$ must have the form $6k-1$ (remainder of 5) and $q$ the form $6k+1$ (remainder of 1).
You are considering $x$ such that $2x-1 = p$ and $2x+1 = q$, so therefore $z=3k$, and that is your answer.