2

$$p(p+1) \equiv -q(q+1) \bmod pq$$

Can this be reduced to an easier format?

Sean Hill
  • 683

2 Answers2

4

Note that $$p(p+1) + q(q+1) = p^2 + q^2 + p + q \equiv p^2 + 2 p q + q^2 + p + q \equiv (p+q)(p+q+1) \mod pq$$ so it's equivalent to $$ (p+q)(p+q+1) \equiv 0 \mod pq $$ Note also that $p+q+1 \equiv (p+1)(q+1) \mod pq$, so this is equivalent to $$(p+q)(p+1)(q+1) \equiv 0 \mod pq$$

Robert Israel
  • 448,999
  • I'm not sure what you mean by that. – Robert Israel Aug 26 '15 at 18:00
  • Not if $\gcd(p+1, pq) > 1$. – Robert Israel Aug 26 '15 at 18:02
  • If you factor $pq = P_1^{d_1} \ldots P_n^{d_n}$ where $P_1, \ldots, P_n$ are primes, then each $P_j^{d_j}$ must divide exactly one of $p+q$ and $p+q+1$. In general some will divide $p+q$ and others will divide $p+q+1$, and $pq$ itself won't divide either. – Robert Israel Aug 26 '15 at 18:08
  • For example, try $p = 6$, $q = 3$, $pq = 18$: $(p+q)(p+q+1) = 90 \equiv 0 \mod 18$, but $18$ doesn't divide either $p+q = 9$ or $p+q+1 = 10$. – Robert Israel Aug 26 '15 at 18:14
  • I suspect there are only finitely many solutions for any fixed $p$, and for most $p$ there will be none. The only solutions for $1 \le p \le q \le 1000$ are $$[p,q] = [1, 1], [1, 2], [2, 2], [2, 3], [2, 6], [3, 6], [6, 14], [6, 21], [14, 35], [21, 77], [35, 90], [90, 234], [77, 286], [234, 611]$$ – Robert Israel Aug 26 '15 at 18:48
  • Here's something interesting: it looks like each pair $(a(n),a(n+1))$ of consecutive terms in OEIS sequence A101265 (https://www.oeis.org/A101265) satisfy the condition, with $(p+q)(p+q+1)/(pq) = 6$ – Robert Israel Aug 26 '15 at 19:43
  • Also for consecutive terms in A032908, with $5$ instead of $6$. – Robert Israel Aug 26 '15 at 20:05
  • ... and those seem to be all the solutions; at least, there are no others with $p+q \le 10^5$ – Robert Israel Aug 26 '15 at 20:09
0

Mod $pq$, $p(p+1) \equiv -q(q+1) \iff p^2+p = -q^2-q \iff p^2+q^2 +p+q =0 $

$\begin{array}\\ (p+q+1)^2 &\equiv p^2+q^2+1+2pq+2p+2q\\ &\equiv p^2+q^2+1+2p+2q\\ &\equiv (p^2+q^2+p+q)+p+q+1\\ &\equiv p+q+1\\ \end{array} $

Therefore, if $n = p+q+1$, $n^2 \equiv n$ or $n(n-1) \equiv 0 $.

If $p$ and $q$ are distinct primes (or even just relatively prime), then $gcd(n-1, p) = gcd(n-1, q) = 1$, so that $n \equiv 0 $.

But $n < pq $, so that this can not hold.

marty cohen
  • 107,799