let $p$ and $q$ be two distinct primes such that $p < q$, where $N = p q$. Does $N$ contain any information about $q-p$?

248 Views Asked by At

Let $p$ and $q$ be two distinct primes such that $p < q$, where $N = p q$.

  1. Does $N$ contain any information about $q-p$?

  2. Is it possible to know exactly or estimate the difference between $p$ and $q$?

1

There are 1 best solutions below

2
On BEST ANSWER

Partial answer: If you know $q-p$ exactly, then you can get $p$ and $q$.

Proof. If you knew $q-p$ then you'd know $(q-p)^2=p^2-2pq+q^2$. Adding $4N=4pq$ gives you $(p+q)^2$, which we can square root to get $s=p+q$. From here,

$$p,q=\frac{s\pm\sqrt{s^2-4N}}{2}$$

by the quadratic formula.


In a similar vein, if we were able to estimate $q-p$ very well, we'd be able to just try all the values around it quite quickly to see if they yielded a valid factorization. So, we can't know it too well.