Page 2 of 3
Re: Problem 094
Posted: Wed Feb 22, 2012 2:42 pm
by blegat
Can somebody explain me why 311709883 is not a possible side ?
We have 311709883^2 + (311709884/2)^2 = 269948677^2...
Re: Problem 094
Posted: Wed Feb 22, 2012 4:00 pm
by jaap
blegat wrote:Can somebody explain me why 311709883 is not a possible side ?
We have 311709883^2 + (311709884/2)^2 = 269948677^2...
311709884/2 is not an integer:
Problem 94 wrote:Find the sum of the perimeters of all almost equilateral triangles with integral side lengths and area
Edit: Ignore that - I didn't see what you meant.
If it were the case that
311709883^2 - (311709884/2)^2 = 269948677^2
(note the minus sign that Francky pointed out)
then it would give rise to one of the requested triangles. It is not correct however.
311709883^2 - (311709884/2)^2 = (269948676,9999999925911...)^2
It is close to an integer. However the last digit of left hand side is 3^2-2^2=5, so the right hand side should also end in a 5 if it were an integer.
In fact:
311709883^2 - (311709884/2)^2 = 72872288214050325
269948677^2 = 72872288214050329
Re: Problem 094
Posted: Wed Feb 22, 2012 4:35 pm
by Francky
blegat wrote:Can somebody explain me why 311709883 is not a possible side ?
We have 311709883^2 + (311709884/2)^2 = 269948677^2...
It would have been better if
311709883^2
- (311709884/2)^2 = anInt^2
Re: Problem 094
Posted: Thu Aug 30, 2012 8:01 pm
by KhaledSharif
Can someone tell me why the formula for producing isosceles Heronian triangles found here does not produce all the triangles I require?
http://en.wikipedia.org/wiki/Integer_tr ... _triangles
Re: Problem 094
Posted: Fri Aug 31, 2012 4:12 am
by ffff0
From
http://en.wikipedia.org/wiki/Heronian_t ... _triangles:
"For example, taking m = 36, n = 4 and k = 3 produces a triangle with a = 5220, b = 900 and c = 5400, which is similar to the 5, 29, 30 Heronian triangle."
So, you can obtain all triangles with this method, but you'll need a really big upper limit for perimeter.
Re: Problem 094
Posted: Fri Apr 12, 2013 8:29 am
by MukiJames
Hi,
I tried to apply the already mentioned formula from Wikipedia:
http://en.wikipedia.org/wiki/Heronian_t ... _triangles. The Wiki page says: "
All Heronian triangles can be generated as multiples of", but as far as I see it is not really true, or I misunderstood the meaning of "multiplies". There are triangles which are not generated by this formula but their multiplications. For example the formula doesn't generate 5-5-6, but 10-10-12 (m=n=2, k=1). This means that I cannot really use this formula because there is no upper limit for perimeter.
Could you give me a hint, what is wrong with my thinking, please?
Thanks in advance.
[Edit]: typo
Re: Problem 094
Posted: Fri Apr 12, 2013 9:28 am
by TripleM
The two posts above yours ask and answer that exact same question

Nothing is wrong with your thinking; the multiples can indeed be fractional, so using that formula for values underneath a given limit is probably not going to help you (unless you can find another way of bounding them).
Re: Problem 094
Posted: Fri Apr 12, 2013 9:42 am
by MukiJames
Thanks for the answer. Currently I cannot find out any better solution to find the upper limit for the formula. I think I will look into the next problem now, maybe after a few days I will have a new idea and I will return to this one :)
Re: Problem 094
Posted: Mon Mar 03, 2014 4:55 pm
by satyres
I have made an algorithm that show the correct answer but the sum of all permiter is incorrect ! ?
The number is really big and i'm using (unsigned long long) in C++ but it's wrong !
Those numbers are correct ?
12=5 5 6
120=17 17 16
1848=65 65 66
25080=241 241 240
351780=901 901 902
Thanks for the help!
Re: Problem 094
Posted: Mon Mar 03, 2014 8:13 pm
by dawghaus4
satyres wrote:I have made an algorithm that show the correct answer but the sum of all permiter is incorrect ! ?
The number is really big and i'm using (unsigned long long) in C++ but it's wrong !
Those numbers are correct ?
12=5 5 6
120=17 17 16
1848=65 65 66
25080=241 241 240
351780=901 901 902
Thanks for the help!
The left side of your equals are the correct areas for triangles having sides you have listed on the right side.
If you are using Heron's formula (some refer to it as Hero's formula) to calculate the areas, you will need to use a "big integer" package of some sort. Although the areas will all fit comfortably in 64-bit integers, the squares (before you extract the square roots) will exceed the 64-bit range of values.
You might consider a different approach. (I don't know how much I should say about a different approach.)
Tangentially, how did Heron's name come to be Hero? It is the same way that Platon's name came to be Plato.
Re: Problem 094
Posted: Mon Mar 03, 2014 8:40 pm
by satyres
dawghaus4 wrote:
The left side of your equals are the correct areas for triangles having sides you have listed on the right side.
If you are using Heron's formula (some refer to it as Hero's formula) to calculate the areas, you will need to use a "big integer" package of some sort. Although the areas will all fit comfortably in 64-bit integers, the squares (before you extract the square roots) will exceed the 64-bit range of values.
You might consider a different approach. (I don't know how much I should say about a different approach.)
Tangentially, how did Heron's name come to be Hero? It is the same way that Platon's name came to be Plato.
Hi , and thanks for the reply !
i did not use any formula ! but i still don't know why my result is wrong !?
Re: Problem 094
Posted: Tue Mar 04, 2014 2:21 am
by dawghaus4
It's not possible for us to say what is wrong with your program. In your original post, you hinted that you were concerned about overflow. Certainly, that will cause you to miss. As I stated earlier, Heron's formula will overflow. So will the Pythagorean theorem.
But you said you are not using a formula, so we don't know how you are computing the areas. Regardless, have you verified that overflow is not an issue?
[on edit] The biggest number my program dealt with contained 16 digits.
Re: Problem 094
Posted: Tue Mar 04, 2014 7:14 am
by satyres
dawghaus4 wrote:It's not possible for us to say what is wrong with your program. In your original post, you hinted that you were concerned about overflow. Certainly, that will cause you to miss. As I stated earlier, Heron's formula will overflow. So will the Pythagorean theorem.
But you said you are not using a formula, so we don't know how you are computing the areas. Regardless, have you verified that overflow is not an issue?
[on edit] The biggest number my program dealt with contained 16 digits.
Thanks for the reply !
i have found this number : 312530501185190475 as the sum of all permiter under 1 billion !
Can i Pm the code in order to found the error ?
Thanks so much !
Re: Problem 094
Posted: Tue Mar 04, 2014 12:36 pm
by dawghaus4
satyres wrote:
Thanks for the reply !
i have found this number : 312530501185190475 as the sum of all permiter under 1 billion !
Can i Pm the code in order to found the error ?
Thanks so much !
You can, but I doubt if I would be able to resolve your issue. I am a beginning programmer, having started learning C++ in September of last year. If you are using another language, I probably couldn't follow it. I don't even know how well I could follow someone else's program written in C++. But I'd try.
With a sum that big, you must be adding lots of perimeters of triangles that don't meet the criteria. Since the largest possible perimeter is 1,000,000,000, you would have to have found tens of millions of triangles. I'm not sure I'm allowed to say how many triangles there are, but it is much, much fewer than that.
Re: Problem 094
Posted: Wed Mar 12, 2014 9:05 pm
by satyres
dawghaus4 wrote:
You can, but I doubt if I would be able to resolve your issue. I am a beginning programmer, having started learning C++ in September of last year. If you are using another language, I probably couldn't follow it. I don't even know how well I could follow someone else's program written in C++. But I'd try.
With a sum that big, you must be adding lots of perimeters of triangles that don't meet the criteria. Since the largest possible perimeter is 1,000,000,000, you would have to have found tens of millions of triangles. I'm not sure I'm allowed to say how many triangles there are, but it is much, much fewer than that.
Thanks for your help ! problem solved i had a precision problem in double

Re: Problem 094
Posted: Mon Oct 06, 2014 12:06 am
by paragnomen
Hi,
Could anyone explain me why triangles such as:
Expand
(92604733,92604733,92604734),
(185209465,185209465,185209464),
(194291787,194291787,194291788),
(253000835,253000835,253000836),
(286896519,286896519,286896518),
(311709883,311709883,311709884)
are invalid almost equilateral triangles?
Each triangle has integral sides, integral area and perimeter below one billion.
Other triangles are okay, but these not, especially 1st from above is strange - it comes up between
and
.
I'd be really grateful if someone would point me that mistake.
Re: Problem 094
Posted: Mon Oct 06, 2014 12:23 am
by Marcus_Andrews
They do not have integral area.
For example, the first one has area 3713359590086716.71132486...
Re: Problem 094
Posted: Mon Oct 06, 2014 12:33 am
by paragnomen
OK, I see... So my mistake was lack of precision in floating point numbers. Thanks for your help!

Re: Problem 094
Posted: Sun Feb 08, 2015 3:41 pm
by Oliver1978
satyres wrote:I have made an algorithm that show the correct answer but the sum of all permiter is incorrect ! ?
The number is really big and i'm using (unsigned long long) in C++ but it's wrong !
Those numbers are correct ?
12=5 5 6
120=17 17 16
1848=65 65 66
25080=241 241 240
351780=901 901 902
Thanks for the help!
I get completely different values. I guess satyres isn't mentioning perimeters but the area of the respective triangle. Assuming his n's are right, shouldn't the perimeters be like 16, 50, 196, 722, 2704, making this a total of 3688?
Re: Problem 094
Posted: Sun Feb 08, 2015 8:49 pm
by hk
See the post directly below the post you copied those data from.
I assume that calculating the perimeter of a triangle given the sides isn't rocket science for you.
If the given triangles are the ones you are looking for is something for you to find out.