Each of p and q is a 6-digit base ten positive integer with no leading zero. The 12-digit number that is obtained by writing p and q side-by-side is divisible by the product p*q.
Determine all possible pair(s) (p, q) for which this is possible.
1) n = (1000000p + q)/pq , where n is a integer
2) Multiplying by q,
qn = 1000000 + (q/p)
Since qn is an integer, so is q/p.
Let q/p = k, where k must be an integer between 1 and 9.
3) Since q is <= 999999
And qn >= 1000001
It follows that n must be >= 2
4) q = (1000000 + k)/n
p = (1000000 + k)/kn
Since p is integral, k must divide 1000000.
k must be 1,2,4,5 or 8
But p <= 999999, so kn must be <10
But n > 2, so k must be 1,2 or 4
5) There are only three possibilities where
a) k is 1,2 or 4
b) n < 10/k, and
c) n divides (1000000 + k),
and only one leads to an integral p:
k 1000000 + k n q p
-- -------------- --- --------- ---------
2 1000002 3 333334 166667 <-- only solution
2 1000002 2 500001 250000.5 <-- p not integral
4 1000004 2 500002 125000.5 <-- p not integral
So, Dej Mar's solution is the only one