04 Jan '08 10:55

The sum of 5 integers is 25.

The product of the same 5 integers is 2520.

What are the numbers?

The product of the same 5 integers is 2520.

What are the numbers?

- Joined
- 11 Nov '05
- Moves
- 43938

- Joined
- 20 Sep '04
- Moves
- 16434

Eastbourne- Joined
- 11 Nov '05
- Moves
- 43938

- Joined
- 31 May '07
- Moves
- 696

04 Jan '08 12:391 edit2520 = 2x2x2x3x3x5x7

2+2+2+3+3+5+7 = 24 and is 7 numbers, so we need to get to 25 by combining two of the numbers.

2+2+6+3+5+7 = 25 and is 6 numbers, so combine the two which doesn't change their sum.

4+6+3+5+7 = 25 and 4x6x3x5x7 = 2520.

as this is the only answer, a nicer question might have been "5 numbers have a sum of 25 and product of 2520. Are the number's consecutive?"- Joined
- 09 Jun '07
- Moves
- 45641

In the den- Joined
- 28 Mar '06
- Moves
- 11360

Porto, Portugal04 Jan '08 15:241 editdef notInSolutions(sols, i1, i2, i3, i4, i5):

for sol in sols:

if i1 in sol and i2 in sol and i3 in sol and i4 in sol and i5 in sol:

return False

return True

solutions = []

for i1 in xrange(25):

for i2 in xrange(25):

for i3 in xrange(25):

for i4 in xrange(25):

for i5 in xrange(25):

if i1+i2+i3+i4+i5 == 25 and i1*i2*i3*i4*i5 == 2520:

if notInSolutions(solutions,i1,i2,i3,i4,i5):

print i1,i2,i3,i4,i5

solutions.append([i1,i2,i3,i4,i5])

Run this in Python and you'll find out that the only solution is any combination of the one posted above 🙂

EDIT: The editor here messed up my tabs so you'll have to actually tab it correctly for it to work in Python. Nevertheless notice that this is not an optimal implementation of a solver for this problem :p- Joined
- 11 Nov '05
- Moves
- 43938

- Joined
- 26 Nov '07
- Moves
- 1085

04 Jan '08 16:57

No, it's not unique. We're working over the integers, so {21, 5, 4, -3, -2} works.*Originally posted by wolfgang59***to start with factorise 2520**

the answer pops out when you realise 5 numbers adding to 25 are gonna be averaging 5....

anyone clever enough to prove answer is unique? I'm not!- Joined
- 09 Jun '07
- Moves
- 45641

In the den- Joined
- 26 Nov '07
- Moves
- 1085

04 Jan '08 21:18

I actually assumed it was a trick question and was looking for positive and negative numbers from the start. It was only after I had my solution that I read the rest of the thread, and that actually I was being overly complicated...*Originally posted by wolfgang59***Nice one. I didnt think the solution was unique!**- Joined
- 28 Mar '06
- Moves
- 11360

Porto, Portugal- Joined
- 26 Nov '07
- Moves
- 1085

06 Jan '08 09:201 edit

Edited while I think about it some more...*Originally posted by FabianFnas***Thank you all of you for the effort.**

Yes, the numbers are 3, 4, 5, 6, and 7

Trial and error is on good method, but I liked the faktorisation!

If the integers don't have to be positive, is there any more solutions then? (I don't know myself.)