Is there a way to determine, given distinct primes $q, p$, the unique $n \in \{q, q+1, \ldots, q+p-1\}$ such that $\gcd(n, p) \gt 1$?
2026-03-25 09:29:06.1774430946
Let $q$, $p$ be distinct primes. Determine unique $n$ in $\{q, q+1, \ldots, q+p-1\}$ such that $\gcd(p, n) > 1$
52 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
If we have $p$ consecutive numbers, exactly one is divisble by $p$, which is equavalent that it is not coprime to $p$.
If $p<q$ , and $s\equiv q \mod p$ with $0<s<p-1$, then take $q+p-s$
If $p>=q$ , $p=q+(p-q)$ is contained in the given set because of $0\le p-q<p-1$
In short , calculate $q$ modulo $p$ , denote the result $s$ and take $p+q-s$.
So, a formula would be $p+q- (q\mod p)$