Go back
Five numbers

Five numbers

Posers and Puzzles

F

Joined
11 Nov 05
Moves
43938
Clock
04 Jan 08
Vote Up
Vote Down

The sum of 5 integers is 25.
The product of the same 5 integers is 2520.
What are the numbers?

c
Copyright ©2001-2006

Eastbourne

Joined
20 Sep 04
Moves
16434
Clock
04 Jan 08
2 edits
Vote Up
Vote Down

Originally posted by FabianFnas
The sum of 5 integers is 25.
The product of the same 5 integers is 2520.
What are the numbers?
*EDITED ANSWER*

*EDITED METHOD*

F

Joined
11 Nov 05
Moves
43938
Clock
04 Jan 08
Vote Up
Vote Down

Originally posted by celticcountry
*EDITED ANSWER*

*EDITED METHOD*
It took six minutes for you to figure this one out!
(He mailed the answer to me)

d

Joined
31 May 07
Moves
696
Clock
04 Jan 08
1 edit
Vote Up
Vote Down

2520 = 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?"

wolfgang59
Quiz Master

RHP Arms

Joined
09 Jun 07
Moves
48794
Clock
04 Jan 08
Vote Up
Vote Down

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!

M
Not the dead

Porto, Portugal

Joined
28 Mar 06
Moves
11360
Clock
04 Jan 08
1 edit
Vote Up
Vote Down

def 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

F

Joined
11 Nov 05
Moves
43938
Clock
04 Jan 08
Vote Up
Vote Down

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.)

S

Joined
26 Nov 07
Moves
1085
Clock
04 Jan 08
Vote Up
Vote Down

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!
No, it's not unique. We're working over the integers, so {21, 5, 4, -3, -2} works.

wolfgang59
Quiz Master

RHP Arms

Joined
09 Jun 07
Moves
48794
Clock
04 Jan 08
Vote Up
Vote Down

Nice one. I didnt think the solution was unique!

S

Joined
26 Nov 07
Moves
1085
Clock
04 Jan 08
Vote Up
Vote Down

Originally posted by wolfgang59
Nice one. I didnt think the solution was unique!
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...

M
Not the dead

Porto, Portugal

Joined
28 Mar 06
Moves
11360
Clock
06 Jan 08
Vote Up
Vote Down

Originally posted by Swlabr
No, it's not unique. We're working over the integers, so {21, 5, 4, -3, -2} works.
Ah negative numbers.... didn't think of that :p

S

Joined
26 Nov 07
Moves
1085
Clock
06 Jan 08
1 edit
Vote Up
Vote Down

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.)
Edited while I think about it some more...

Cookies help us deliver our Services. By using our Services or clicking I agree, you agree to our use of cookies. Learn More.