# Find all $p,q$ such that $(5p+q) \mid 168$ and $(5p-q) \mid 168$

Let $p,q$ with $p < q$ be coprime positive integers. Find all $p,q$ such that $(5p+q) \mid 168$ and $(5p-q) \mid 168$.

I first factorized $168 = 2^3 \cdot 3 \cdot 7$ but didn't see how to use the system of divisibility to continue. How do we use the system of divisibility here in order to solve the question?

Hint: There are $16$ positive divisors of 168. There are $32$ positive or negative divisors of $168$.

You can construct the system \begin{align} 5p+q&=a\\ 5p-q&=b \end{align} where $a$ is a positive divisor of $168$ and $b$ is a positive or negative divisor. Solve the simultaneous system for $p$ and $q$, using the fractions which appear to figure out what $a$'s and $b$'s are possible.

• Note that $a$ and $b$ have to have the same parity as $a-b=2q$. That cuts the number of cases to check considerably. Also we need $a\equiv -b \pmod 5$ Once you satisfy both of those, there will be a solution. – Ross Millikan Jan 4 '17 at 20:31

The (positive) divisors of $168$ are

$$1,3,7,21,\\2,6,14,42,\\4,12,28,84,\\8,24,56,168$$

Let $a$ and $b$ be any of these or their negatives. If $a=5p+q$ and $b=5p-q$, then $a+b=10p$ and $a-b=2q$, so $a$ and $b$ must have the same parity and sum to a multiple of $10$. If $p$ and $q$ are coprime, then $\gcd(a+b,a-b)=\gcd(10p,2q)=2\gcd(5p,q)=2$, since $\gcd(p,q)=1$ and $5\not\mid q$ (because $5\not\mid168$).

This leaves a relatively short list of possibilies for $(a,b)$. Listing them with $a\gt b$, the possibilities are

$$(21,-1),\\(7,3),\\ (12,-2),(28,2),(8,2),(168,2)\\ (6,4),(56,-6),\\ (14,-4),(24,-14)\\ (42,8)$$

(where each row takes a number from the list at top of divisors and picks out all later numbers from that list that satisfy the conditions). These lead to $(p,q)$ pairs

$$(2,11),\\ (1,2),\\ (1,7),(3,13),(1,3),(17,83),\\ (1,1),(5,31),\\ (1,9),(1,19),\\ (5,17)$$

The OP's stipulation that $p\lt q$ eliminates $(1,1)$.