Spoiler for New Scientist Enigma 1734: “Friendly factors” (Follow the link to see the puzzle.)
This took some sweat. (I was confused by the wording at first: “For every pair of friends, their answer to both a and b was the same” means each a is the same as the corresponding b, not that all as and all bs are the same. Maybe that’s obvious to everyone but yesterday’s me.)
(NOTE: Herein, whenever I talk about “factors”, I implicitly mean prime factors.)
Table of number of letters in common (which equals number of common factors) follows:
Since each of the names translates to a 3-figure number, and I assume that means leading zeros are disallowed, we know N, P, R, and T are not 0.
Consider ROD and RON, with 2 common factors. Any factor of both must also be a factor of their difference, |D–N|, so their difference must be a number <10 with at least two distinct prime factors. There is only one such number, 6, so the common factors of ROD and RON must be 2 and 3. D and N must be even. They can be 0 and 6 or 2 and 8.
Likewise the difference of TIM and TOM must be a 2-figure number ending in 0 whose factors include the 2 common factors of TIM and TOM. Such a number must have factors 2 and 5, and may have factors 3 or 7 (but not both). So the common factors of TIM and TOM must be at least one of 2 and 5 and could be both, or the other could be 3 or 7. But TIM has no factors in common with ROD or RON. So the common factors of TIM and TOM can only be 5 and 7. These cannot be factors of either ROD or RON, which means D and N are not 0, which means they can only be 2 and 8.
TIM and TOM are odd multiples of 35, with the same first digit (not 5), containing neither 2 nor 8, and TIM is not divisible by 3. The only possibility is TIM = 175, TOM = 105. The factors of TOM are 3, 5, and 7, with 3 the common factor with RON and ROD. The factors of TIM are 5 and 7.
PAT has 1 factor in common with both TIM and TOM but none in common with RON or ROD. So PAT must be a multiple of 7, but not 2, 3, or 5. If PAT has two prime factors of 11 or more, their product must be < 1000/7, but this is impossible. So PAT has no more than one such prime factor. 7 x 7 x 7 = 343 with repeated digits, so PAT has one such prime factor. PAT then is 7 times a prime or 7 x 7 times a prime and ends with 1, and it contains no 0, 2, 5, 7 or 8. It must be 931 = 7 x 7 x 19.
RON and ROD start with R = 4 or 6 (the only digits left), then O = 0, then 2 and 8, with R+O+2 a multiple of 3 so R = 4. They’re 402 = 2 x 3 x 67 and 408 = 2 x 2 x 2 x 3 x 17.
Now E must be 6 and NED = 268 or 862. 268 = 4 x 67 which has an illegal common factor with ROD or RON, so NED = 862 = 2 x 431 and RON = 408, ROD = 402.
O is 0, T is 1, D is 2, A is 3, R is 4, M is 5, E is 6, I is 7, N is 8, P is 9. PRINTED is 9478162.