Page 1 of 2

Problem 276

Posted: Mon Feb 01, 2010 3:08 pm
by kvom
The problem states a<=b<=c. Is GCD(a,a) considered to be equal to 1 when a is prime?

Also, I wonder if the answer for a smaller limit could be posted as an algorithm check.

(Link to problem added by moderator: Problem 276 (View Problem))

Re: Problem 276

Posted: Mon Feb 01, 2010 4:27 pm
by harryh
GCD(x,x)=x always (irrespective of whether x is prime or not)

Re: Problem 276

Posted: Mon Feb 01, 2010 9:42 pm
by SynK
Is the GCD function a Greatest Common Denominator, or is it some other function that I should know but cannot think of now? Thanks for the help.

-S

Re: Problem 276

Posted: Mon Feb 01, 2010 10:09 pm
by hk
It is the greatest common divisor.
See: http://en.wikipedia.org/wiki/Greatest_common_divisor

Re: Problem 276

Posted: Tue Feb 02, 2010 8:33 am
by jvdmeer
If I understand the problem right, we don't have to consider the rule a2+b2=c2.

So a=1, b=1000, c=1000 for example is a valid triangle?
And a=2, b=1000, c=1000 for example is a invalid triangle?

Thanks for the help!

Re: Problem 276

Posted: Tue Feb 02, 2010 2:06 pm
by harryh
That rule applies only to right-angle triangles. Problem 276 (View Problem) poses no such restriction.
Yes and yes (for the last two questions).

Re: Problem 276

Posted: Tue Feb 02, 2010 4:13 pm
by kvom
From the above, it seems that GCD(a,b,c)=1 is not the same as GCD(a,b)=1 AND GCD(b,c)=1

Re: Problem 276

Posted: Tue Feb 02, 2010 4:27 pm
by harryh
No, it is not. The dotted line below gcd(a,b,c) in the problem description, means a tooltip explanation. Hovering your mouse over it, you'll see:
p276.gif
Good luck!

Re: Problem 276

Posted: Wed Feb 03, 2010 2:43 pm
by MacPr1mE
If I understood the problem correctly, each side has to be a prime so gcd(a,b,c)=1 ist true, right?
So isn't this assumption wrong?
jvdmeer wrote:So a=1, b=1000, c=1000 for example is a valid triangle?
And a=2, b=1000, c=1000 for example is a invalid triangle?

Re: Problem 276

Posted: Wed Feb 03, 2010 2:57 pm
by hk
MacPr1mE wrote:If I understood the problem correctly, each side has to be a prime so gcd(a,b,c)=1 ist true, right?
No wrong.
Consider gcd(25,49).
25 and 49 have no common factor, so gcd(25,49)=1.
Neither 25 nor 49 is prime.
gcd(a,b,c) should return the gratest common factor of a, b and c.
So gcd(14,21,35)=7, because 14=2*7, 21=3*7 and 35=5*7
But gcd(14,21,36)=1 because 14, 21 and 36 have no common factor.

Re: Problem 276

Posted: Wed Feb 03, 2010 8:16 pm
by jvdmeer
Just a algorythm-check:

For a max perimeter [le] 100, I get an answer of 6067 triangles with a gcd(a,b,c)=1
For a max perimeter [le] 1000, I get an answer of 5865423 triangles with a gcd(a,b,c)=1

Can someone check this?

Re: Problem 276

Posted: Wed Feb 03, 2010 9:15 pm
by Lord_Farin
jvdmeer wrote:Just a algorythm-check:

For a max perimeter [le] 100, I get an answer of 6067 triangles with a gcd(a,b,c)=1

Can someone check this?
I haven't solved the problem, but my algo gives me 6033 such triangles. Also, for p[le]1000, I get 5803431. I would appreciate some feedback.

Re: Problem 276

Posted: Fri Feb 05, 2010 3:32 pm
by ThomasH
Lord_Farin wrote:I haven't solved the problem, but my algo gives me 6033 such triangles. Also, for p[le]1000, I get 5803431. I would appreciate some feedback.
Both values are ok - and both values can easily be brute forced.

Re: Problem 276

Posted: Fri Feb 05, 2010 7:47 pm
by Jochen_P
AHahahaha ... hah .. errr.

I got 23384 for p <= 100 and 23137742 for p <= 1000.
No wonder I am stuck with this :shock:

Re: Problem 276

Posted: Wed Feb 05, 2014 8:10 pm
by martina_qu
I am surprised to see, that my solution with the primitive triangles does not fit. I applied the Pythagoras-algorithm and counted the trivial ones. I do not understand from the description where is the misconcept. Reading here I get the idea that non-right-triangles might work as well. Are there samples for the triangles which might fit as well? At least one additional sample on the page would have been beneficial. :?

Re: Problem 276

Posted: Wed Feb 05, 2014 9:11 pm
by mpiotte
martina_qu wrote:I am surprised to see, that my solution with the primitive triangles does not fit. I applied the Pythagoras-algorithm and counted the trivial ones. I do not understand from the description where is the misconcept. Reading here I get the idea that non-right-triangles might work as well. Are there samples for the triangles which might fit as well? At least one additional sample on the page would have been beneficial. :?
primitive integer sided triangles example #1: a=1, b=1, c=1
primitive integer sided triangles example #2: a=6, b=10, c=15

Re: Problem 276

Posted: Wed Feb 05, 2014 10:32 pm
by martina_qu
Sorry, but now I completely off the track. Under triangle I understand a geometric figure with three different corners `which are located anywhere in a (x,y) coordinate-system. And the distance between the so called corners is named length and they are individually named by a,b,c. Additionally the name tri-angle refers to the fact of a geometric figure enclosing 3 angles.

The sample with a=1, b=1, c=1 cannot be constructed unless it is a straight line. But then it fails to have 3 different edges. And therefore cannot be called triangle.
And the sample with 6,10,15 can also not be constructed geometrically as a triangle.

So, what is it, that you call triangle?

Re: Problem 276

Posted: Wed Feb 05, 2014 11:10 pm
by TripleM
Image

Here is a triangle where all three sides are the same length. Let this length be 1. Then you have a triangle with a=b=c=1.

Re: Problem 276

Posted: Thu Feb 06, 2014 1:00 pm
by martina_qu
Thx for the picture :) As it says, one pic says more then 1000 words. May I suggest to update the question in that sense, that you provide at least the information you have posted here? i.e. the two tuples (1,1,1) [+pic?] and (6,5,10) cause the first is so trivial one might skip it as well as there exists no right-corners triangles as well. Perhaps you could also add the triple (6,6,11).

I am aware that these information might not get into the direction of solution but would help to have a clear understanding what might be requested and which thinking-lapsus could be avoided. At least this would have helped me a lot.

Re: Problem 276

Posted: Thu Feb 06, 2014 1:39 pm
by hk
Why shoudn't there exist right corner triangles?
Take for instance the triangle (3,4,5).
I think you have to update your notion what a triangle is.
Here's a page to begin with Wikipedia