Page 1 of 1
Problem 222
Posted: Wed Dec 24, 2008 3:44 pm
by ozgur
My shortest pipe results in two intersecting spheres. One sphere (sn) in the middle intersects with the sphere two levels below it (sn-2). To account for that, I move sn along the pipe a little so that it does not intersect with sn-2. Am I on the right track, or should the correct solution result in no such intersections?
Re: Problem 222
Posted: Wed Dec 24, 2008 4:35 pm
by ed_r
No intersections.
Re: Problem 222
Posted: Wed Sep 09, 2009 6:52 am
by axelbrz
Hi, can anyone confirm me if the length in micrometers of the shortest pipe, of internal radius 50mm, that can fully contain 3 balls of radii 48mm, 49mm and 50mm, is 293949?
Thank you!
Re: Problem 222
Posted: Wed Sep 09, 2009 9:35 am
by stijn263
Just putting the 3 balls on top of eachother you arrive at 294,000 micrometers. So 293,949 seems correct, but you should be able to verify this for yourself (by checking all 6 configurations)
Re: Problem 222
Posted: Wed Sep 09, 2009 3:22 pm
by axelbrz
Yes, I did it! :) But I just wanted to know if I got the concept because my answer is wrong.
I'll check it.
Thanks!
Re: Problem 222
Posted: Thu Sep 10, 2009 9:00 am
by axelbrz
Mmm.. I'm also getting a wrong answer...
Can anyone confirm me if the shortest length of the pipe in micrometers for balls with radii 28, 31, 34, 35, 36, 37, 40, 45, 49 and 50 mm is 648649?
Thanks!
Re: Problem 222
Posted: Thu Sep 10, 2009 1:04 pm
by daniel.is.fischer
No, it can't be that short.
Re: Problem 222
Posted: Thu Sep 10, 2009 1:06 pm
by daniel.is.fischer
axelbrz wrote:Hi, can anyone confirm me if the length in micrometers of the shortest pipe, of internal radius 50mm, that can fully contain 3 balls of radii 48mm, 49mm and 50mm, is 293949?
Thank you!
No, it's 293933.
Re: Problem 222
Posted: Thu Sep 24, 2009 9:13 pm
by x10
I'm sorry to be reiterating the topic, but could anyone please post their answer for balls of sizes 40, 41... 50?
I get 983801.638816
Re: Problem 222
Posted: Thu Sep 24, 2009 9:23 pm
by daniel.is.fischer
Too close to the problem's parameters to post the correct value, but yours is too high, the correct value is 981xxx.yyyyy
Re: Problem 222
Posted: Sun Dec 27, 2009 11:40 pm
by mirzauzairbaig
Can anyone please list any particular basic topics that I need to go through to work on this problem ?
Re: Problem 222
Posted: Mon Dec 28, 2009 3:04 am
by TripleM
The best part about Project Euler is that you need to come up with the answers all by yourself, you won't be finding hints online
Let's just say that a brute force approach doesn't need to check all N!/2 possibilities.
Re: Problem 222
Posted: Mon Dec 28, 2009 9:45 am
by daniel.is.fischer
Let's say a brute force approach is supposed to not be a good idea. Look at the function that gives you the length or saved length locally. It has a property which lets you find the optimal arrangement quite easily (assuming what you're studying is mathematics or has a large mathematical component, like physics).
Re: Problem 222
Posted: Mon Dec 28, 2009 11:37 pm
by TripleM
Or that. Either way gives a fast answer

Re: Problem 222
Posted: Fri Jan 21, 2011 11:05 pm
by jui-feng
x10 wrote:I'm sorry to be reiterating the topic, but could anyone please post their answer for balls of sizes 40, 41... 50?
I get 983801.638816
It's kind of funny I was getting exactly the same (invalid) response for 40-50. It seems like we both made the same mistake that resulted in the same result, I only had some more decimal places (double precision).
Anyway, I solved it now.
Re: Problem 222
Posted: Fri May 08, 2026 9:53 pm
by yourmaths
One small quibble over the rounding of the final answer here. Let's say the answer to the problem is 123.4 micrometres. Rounding this (down since 0.4 < 0.5) we get 123 but this is no longer the shortest pipe since the sphere on top is now 0.4 micrometres above the top of the pipe. So my interpretation would be that the answer should be rounded up in all cases, giving 124, which was not accepted, but 123 was.
Re: Problem 222
Posted: Sun May 10, 2026 10:10 pm
by DJohn
yourmaths wrote: Fri May 08, 2026 9:53 pm
One small quibble over the rounding of the final answer here. Let's say the answer to the problem is 123.4 micrometres. Rounding this (down since 0.4 < 0.5) we get 123 but this is no longer the shortest pipe since the sphere on top is now 0.4 micrometres above the top of the pipe. So my interpretation would be that the answer should be rounded up in all cases, giving 124, which was not accepted, but 123 was.
But that is not what the problem is asking for. What you're doing is finding the shortest integer length that satisfies the conditions. The problem is asking you to find the shortest length (which is not necessarily an integer) and then to round it to the nearest integer. That's a different thing. There's nothing in the problem statement that suggests that the rounded number has to meet any conditions other than being the closest integer to the shortest length.