Problem 094

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.

This forum is NOT meant to discuss solution methods for a problem.

In particular don't post any code fragments or results.

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one


See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
pjt33
Posts: 140
Joined: Mon Oct 06, 2008 6:14 pm

Problem 094

Post by pjt33 »

I'm convinced that my solution for 94 is finding the correct triangles, because using the output I was able to find the relevant sequences in Sloane's and they agree for the entire of the relevant range.

However, it won't accept either of my answers (one assuming that (1,1,0) is valid, and the other that it isn't).

To check my understanding (which could be wrong, because I can't parse the sentence "Find the sum of the perimeters of every almost equilateral triangle with integral side lengths and area and whose perimeters do not exceed one billion (1,000,000,000)" as grammatical English - should that say "whose perimeter does not"?): if 1E9 were replaced with 50, would the answer be (1+1+2)+(5+5+6)+(17+17+16)?

(Link to problem added by moderator: Problem 94 (View Problem))
User avatar
daniel.is.fischer
Posts: 2400
Joined: Sun Sep 02, 2007 11:15 pm
Location: Bremen, Germany

Re: Problem 94

Post by daniel.is.fischer »

No. Only nondegenerate triangles should be considered, so (1,1,0) and (1,1,2) aren't valid.

Would "Find the sum of the perimeters of all almost equilateral triangles with integral side lengths and area and whose perimeters do not exceed one billion" be a good and grammatically correct sentence?
Il faut respecter la montagne -- c'est pourquoi les gypaètes sont là.
pjt33
Posts: 140
Joined: Mon Oct 06, 2008 6:14 pm

Re: Problem 94

Post by pjt33 »

That would be it! Thanks.

Yes, replacing "every" with "all" turns a singular noun phrase into a plural noun phrase.
tiny
Posts: 10
Joined: Tue Aug 05, 2008 10:51 am

problem 94

Post by tiny »

The text says: whose perimeters do not exceed 1.000.000.000

Does this mean, that for every triangle the perimeter is less than 1.000.000.000?

Or does it mean, that all the perimeters of the triangles together are less than 1.000.000.000?
User avatar
Tommy137
Posts: 238
Joined: Sun Feb 24, 2008 6:02 pm
Location: Cologne, Germany
Contact:

Re: problem 94

Post by Tommy137 »

tiny wrote:Does this mean, that for every triangle the perimeter is less than 1.000.000.000?
Right.
Image
pjt33
Posts: 140
Joined: Mon Oct 06, 2008 6:14 pm

Re: problem 94

Post by pjt33 »

tiny wrote:The text says: whose perimeters do not exceed 1.000.000.000

Does this mean, that for every triangle the perimeter is less than 1.000.000.000?
Almost. It means less than or equal to 1.000.000.000.
bearface
Posts: 5
Joined: Wed Oct 22, 2008 7:50 pm

Problem 094

Post by bearface »

I seem to be having problems handling large integers on this problem. Can someone tell me if I at least have the 5 smallest triangles correct? Sides are
5,5,6
65,65,66
901,901,902
12545,12545,12546
174725,174725,174725

Could you also tell me the 2 largest triangles? I am checking triangles with shortest sides up to and including 333333333.
Thanks for your help.
User avatar
daniel.is.fischer
Posts: 2400
Joined: Sun Sep 02, 2007 11:15 pm
Location: Bremen, Germany

Re: Problem 094

Post by daniel.is.fischer »

You're missing some, e.g. the second smallest.
Il faut respecter la montagne -- c'est pourquoi les gypaètes sont là.
bearface
Posts: 5
Joined: Wed Oct 22, 2008 7:50 pm

Re: Problem 094

Post by bearface »

Daniel - I appreciate your guidance but I guess I need more of a shove in the right direction to figure out what I am missing.

My understanding is we are looking for triangles with integral sides a,a,a+n that have integral area and a perimeter less than a certain amount. n is equal to 1 because 0 is impossible, and the problem constrains n to be no greater than 1. Correct?

I believe you are saying that 5,5,6 and 65,65,66 are valid but that I am missing at least one in between them. I am using Heron's Formula for the area, which becomes Area =.25*sqrt{(3a+1)(a+1)(a+1)(a-1)} where a is the short side. I don't get any other integral areas between a=5 and a=65, although 38 and 54 come close.

Any push in the right direction is appreciated. Thank you.
harryh
Posts: 2091
Joined: Tue Aug 22, 2006 9:33 pm
Location: Thessaloniki, Greece

Re: Problem 094

Post by harryh »

We shall define an almost equilateral triangle to be a triangle for which two sides are equal and the third differs by no more than one unit.
"Differs by no more than one unit" does not necessarily mean "Is one unit larger" :wink:

Also: Please check that a topic for a given problem does not already exist, before starting a new one!
bearface
Posts: 5
Joined: Wed Oct 22, 2008 7:50 pm

Re: Problem 094

Post by bearface »

thanks harryh
MaJJ
Posts: 49
Joined: Tue Oct 14, 2008 12:14 am

Re: Problem 094

Post by MaJJ »

Is 5479171588 as the final answer at least close?

Edit: Nevermind, I just found out where is my error. I worked only with those triangles that differed by 1, not with those that were in fact equilateral...

Edit 2: Wait, there are no equilateral triangles with integral area. Soooo ... What the hell am I missing? :D
Image
Image
MaJJ
Posts: 49
Joined: Tue Oct 14, 2008 12:14 am

Re: Problem 094

Post by MaJJ »

harryh wrote:"Differs by no more than one unit" does not necessarily mean "Is one unit larger" :wink:
So the third side doesn't have to be integer?
Image
Image
User avatar
elendiastarman
Posts: 410
Joined: Sat Dec 22, 2007 8:15 pm

Re: Problem 094

Post by elendiastarman »

Problem 094 (View Problem)

All three sides must be integer (and the area must be integer). Two of them are the same (say, x) and the third is one off (x [plusmn] 1).

That help?
Want some
3.14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679...?
Image
MaJJ
Posts: 49
Joined: Tue Oct 14, 2008 12:14 am

Re: Problem 094

Post by MaJJ »

elendiastarman wrote:Problem 094 (View Problem)

All three sides must be integer (and the area must be integer). Two of them are the same (say, x) and the third is one off (x [plusmn] 1).

That help?
Yeah, that told me I understood the problem the first time and made error somewhere in the algo. Thanks ;)
Image
Image
User avatar
elendiastarman
Posts: 410
Joined: Sat Dec 22, 2007 8:15 pm

Re: Problem 094

Post by elendiastarman »

You're welcome. :)
Want some
3.14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679...?
Image
User avatar
jake223
Posts: 61
Joined: Mon Apr 25, 2011 5:15 am
Location: USA
Contact:

Re: Problem 094

Post by jake223 »

is the partial sum for perimeters under 1000000 716032? I want to see if my algorithm is totally off or just having problems with larger numbers.

never mind. I was just misreading the problem. I was checking for sides going up to 1 billion each, not perimeter.
Image
JMW1994
Posts: 43
Joined: Sat Apr 09, 2011 11:35 pm

Re: Problem 094

Post by JMW1994 »

I know you are supposed to check on whether the lengths and the perimeter are below a billon. However, does the area have to be below a billion as well?
Image
User avatar
hk
Administrator
Posts: 12831
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 094

Post by hk »

Find the sum of the perimeters of all almost equilateral triangles with integral side lengths and area and whose perimeters do not exceed one billion (1,000,000,000).
This means:
1) The sides have integral length.
2) The area is integral.
3) The perimeter should not exceed one billion.
Image
War ruins the life and health of untold numbers of innocent children.
manfazil
Posts: 1
Joined: Thu Dec 22, 2011 1:14 pm

Re: Problem 094

Post by manfazil »

MaJJ wrote:Is 5479171588 as the final answer at least close?

Edit: Nevermind, I just found out where is my error. I worked only with those triangles that differed by 1, not with those that were in fact equilateral...

Edit 2: Wait, there are no equilateral triangles with integral area. Soooo ... What the hell am I missing? :D
I found the same answer but it is wrong! I think there is an wrong triangle in my sum, included due to some round error.
Image
Post Reply