Provide 2 different sets of 3 unique positive integers whose products are the same and the sums are also the same, with each number strictly between 2 and 18.

Provide $\{A, B, C\}$ and $\{X, Y, Z\}$ such that $A+B+C=X+Y+Z$ and $ABC=XYZ$,
and such that the following conditions hold:

(1) $2 \lt A\lt B\lt C\lt 18$;
(2) $2\lt X\lt Y\lt Z\lt 18$; and
(3) $\{A,B,C\}\neq \{X,Y,Z\}$.

  • 1
    $\begingroup$ I suspect you mean two different sets? $\endgroup$
    – joriki
    May 12, 2011 at 11:52
  • 1
    $\begingroup$ @Cogicero: why? $\endgroup$ May 12, 2011 at 12:08
  • $\begingroup$ @Joriki: Yes, two different sets. let me edit the OP $\endgroup$
    – Cogicero
    May 12, 2011 at 12:09
  • $\begingroup$ @Gerry Myerson: :) Its a smaller component of a tougher one I have been wrapping my mind around. Any ideas? $\endgroup$
    – Cogicero
    May 12, 2011 at 12:10
  • $\begingroup$ @Cogicero: Your edit still doesn't say that $(A,B,C)\neq(X,Y,Z)$. $\endgroup$
    – joriki
    May 12, 2011 at 12:30

2 Answers 2


I don't know if you were looking for some number-theoretic insights (or even whether any exist to be found), but a brute-force computer program can easily find all such pairs of triples:

(A, B, C)       (X, Y, Z)       (Sum, Product)
(8, 12, 15)     (9, 10, 16)     (35, 1440)
(3, 8, 10)      (4, 5, 12)      (21, 240)
(5, 9, 14)      (6, 7, 15)      (28, 630)
(4, 9, 10)      (5, 6, 12)      (23, 360)
(3, 10, 12)     (4, 6, 15)      (25, 360)
(4, 10, 14)     (5, 7, 16)      (28, 560)
(6, 10, 14)     (7, 8, 15)      (30, 840)
(4, 8, 15)      (5, 6, 16)      (27, 480)
(6, 12, 14)     (7, 9, 16)      (32, 1008)

("All" up to swapping (A,B,C) and (X,Y,Z), of course.)

Python code if anyone's interested:

ss = {} #Triples which give a certain (sum, product)
for A in range(3,18):
    for B in range(A+1, 18):
        for C in range(B+1, 18):
            p = (A+B+C, A*B*C)
            ss[p] = ss.get(p, []) + [(A,B,C)]
for p in ss:
    if len(ss[p])>=2:
        print ss[p], "\t", p

As for solving it manually, I don't think there is any method that is significantly different from brute force. One can prune the list of choices to consider, but it will still take exhaustive enumeration or trial-and-error to find such triples. An ad hoc method for an ad hoc problem. :-)

For instance — going by trial-and-error and blind guesswork — I might start by trying (4,5) for (A,B). Then 20C = XYZ suggests maybe trying X=10 (because all prime factors of 20 must occur somewhere on the right), after which the equations become {C=1+Y+Z, 2C=YZ}, and you know one of Y,Z must be even; Y=6 doesn't work and Y=8 happens to give a valid solution Z=3. This (after you order them correctly) is one valid pair of triples. But other guesses may lead to lots of blind alleys and backtracking, so I don't really recommend this method. Then again, I suspect there is nothing much better.

  • $\begingroup$ I got more. These arent all such triples. $\endgroup$
    – Shahab
    May 12, 2011 at 13:17
  • $\begingroup$ @Shahab: Wow, really? Well, my program is short and simple enough that I'm pretty sure these are all. Can you point one triple not covered? [BTW, did you take into account that 2<A<B<C<18? Maybe you included 2 or 18, or didn't have all 3 numbers distinct…] $\endgroup$ May 12, 2011 at 13:19
  • $\begingroup$ I get the same set of 9 $\endgroup$ May 12, 2011 at 13:24
  • $\begingroup$ Oh! Sorry, you are correct....I was taking 2 and 18 inclusive. $\endgroup$
    – Shahab
    May 12, 2011 at 13:24
  • $\begingroup$ Thanks, ShreevatsaR. Yes I am looking for a number-theoretic (sic) method and not brute force. Do you have any insights on solving this manually? $\endgroup$
    – Cogicero
    May 12, 2011 at 13:31

How to in Excel: Make a table with 455 lines, one for each set of 3 numbers. Start with a column from 4 through 17 (use Fill Series to make it) and put 2 and 3 in the next two columns. Then copy everything except the first line and change the 3 to a 4. With copy and fill down to make the changes it takes about 2 min. This was columns A, B, and C. Then make column D the sum and E the product. To find the duplicates, column F=E^2+D (think of the Cantor pairing function) and sort on column F. In G1, put =F2-F1 and copy down and you will find pairs in column F by zeros in column G.

Added after comment: The first part is just to get all possibilities into columns ABC of 455 lines. One could write some equations to do this, or type them in, or use this compromise. If I am iterating more than 2000 or so, I go to Python, but under that Excel is my tool of choice. Then in column D goes the sum of ABC and in E the product. Now we have to find a way to find the matches. You could just sort the whole matrix on column D and then on E, but combining the two into F does it with one sort. Then you still want to make the matches visible and putting the difference into G does that.

  • $\begingroup$ Thanks Ross. Unfortunately I didn't quite get it when I tried the method described above. I might just be slow with Excel. $\endgroup$
    – Cogicero
    May 12, 2011 at 17:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.