1
$\begingroup$

Find all $p, q$ (coprime) such that $\frac{(p-1)(q-1)}{2}$ is a prime number.

I found that $(p,q) = (2,7),(7,2),(2,15),(3,8)$ gave prime numbers for $\frac{(p-1)(q-1)}{2}$, but how do we find all?

  • 0
    can we assume $p$ and $q$ are positive integers for simplicity?2017-01-19
  • 1
    If that prime number is $t$, then $(p-1)(q-1) = 2t$. You know the prime decomposition of the RHS - and the prime decomposition is unique up to $+1$ and $-1$ factors.2017-01-19
  • 0
    @JorgeFernándezHidalgo The question doesn't say, so no.2017-01-19

3 Answers 3

2

Suppose $p,q \ge 3$. Notice that one of $p-1$ or $q-1$ must be even (for$\frac{(p-1)(q-1)}{2}$ to be an integer) hence one of $p$ or $q$ must be odd. If $p$ is odd then $\frac{(p-1)}{2} \cdot (q-1)$ is not prime unless $\frac{p-1}{2}$ is $1$, i.e $p=3$. This allows us to deduce that if $(p,q)$ is a solution, with $p,q \ge 3$, then it is of the form $(3,n+1)$ (or $(n+1,3)$) for some $n$ prime.

If one of $p,q$ is less than $3$, then (since neither can be $1$) one of $p,q$ must be equal to $2$. If this is the case, then the solution $(p,q)$ is of the form $(2,2n+1)$ (or $(2n+1,2)$) for $n$ prime.

Edit: For the case $p,q\le 0$, then we can write $$\frac{(p-1)(q-1)}{2}=\frac{((2-p)-1)((2-q)-1)}{2}.$$

You can then use the answer to the positive case to get your result.

Hope this helps.

  • 0
    This is a bit sloppy. For example if $p, q \ge 3$ then the solution must be of the form $(3, n+1)$ with $n$ prime, right?2017-01-19
  • 0
    Indeed, I was just in the process of changing it as you commented :)2017-01-19
  • 0
    @Zestylemonzi What if $p \leq 3$ or $q \leq 3$?2017-01-19
  • 0
    Does this edit make it clearer?2017-01-19
  • 0
    But they can be negative.2017-01-19
  • 0
    @Puzzled417, you could have answered this question: "can we assume p and q are positive integers for simplicity? – Jorge Fernández Hidalgo"2017-01-19
  • 2
    I mean, the solution is pretty much the same, except we have to add some annoying details. +12017-01-19
  • 1
    By the way, primes of the form $q=2p+1$, for $p$ prime, are called "safe primes" and are usefully notably in cryptography since their evaluation by Euler's totient function $\phi(q)=2p$, naturally has a large prime factor, which is $p$.2017-01-19
0

Starting with the potential that the result is $2$, we need $(p-1)(q-1)=4$, giving $3$ initial options: $(p,q)= \{(2,5),(3,3),(5,2)\}$. However $p=q=3$ violates the requirement for coprime $p,q$, so only the $2$ optinos to get the resulting prime $2$.

Otherwise the result is an odd prime $r>2$ and we need $(p-1)(q-1)=2r$. Then we can have $(p,q) = \{(2,2r+1),(3,r+1), (r+1,3),(2r+1,2)\}$. The first and last of these will be valid for all $r$, but the middle two options require that $3 \nmid r+1$. So primes $r \equiv 2 \bmod 3 $ have $2$ options, and all other primes have $4$ options.

0

If $p, q$ are coprime then at most one is even. Wolog $q$ is odd and $q-1$ is even.

So $(p-1)\frac{q-1}2$ is prime. So either $p-1 = \pm 1$ or $\frac {q-1}2 = \pm 1$.

Case 1: $p-1 = -1$

If $p-1 = -1$ then $p = 0$ and $0$ is not coprime to anything except $\pm 1$. (Everything divides 0) so $q = \pm 1$. $\frac {1-1}2 = 0$ is not prime so $q = -1$ and $\frac {q-1}2 = -1$ and ... $ (p-1)\frac{q-1}2=1$ is not prime.

Case 2: $p-1 = 1$

So $p = 2$ and $\frac {q-1}2 $ is prime. So $q = 2k + 1$ for any prime. i.e. Let $k$ be prime, the $\gcd(2, 2k+1) =1$ and $\frac{(2-1)(2k+1 -1)}2 = k$ is prime.

Case 3: $\frac {q-1}2 = -1$

$q = -1$ and $p= k + 1$ for any prime. i.e. $\gcd(k+1,-1)=1$ and $\frac{(k+1-1)(-1 -1)}2 = -k$ is prime.

Case 4: $\frac{q-1}2=1$

$q = 3$ and $p = k +1$ for any prime $k=3$ or $k \equiv 1 \mod 3$

So options are $(2,2k+1)$ for any prime $k$.

$(-1, k+1)$ for any prime.

$(3,4)$ and $(3,k+1)$ for any prime of the form $k \equiv 1 \mod 3$.

  • 0
    I think we can assume p, and q were meant to be positive.2017-01-20