Integral Co-ordinates

Algebra Level 2

Find the total number of points having integral co-ordinates that lie inside the triangle having vertices as ( 0 , 0 ) (0,0) , ( 0 , 2019 ) (0,2019) and ( 2019 , 0 ) (2019,0) .


Bonus: Can you generalize this for a triangle having vertices as ( 0 , 0 ) ( 0 , n ) (0,0) (0,n) and ( n , 0 ) ? (n, 0)?

Try also Integral Co-ordinates--2 .

Try Also Integral Co-ordinates -3


The answer is 2035153.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Chew-Seong Cheong
Jan 11, 2019

It can be clearly seen that for an isosceles right triangle of leg length n n , the number of points with integer coordinates is the triangular number T n 2 = k = 1 n 1 k = ( n 2 ) ( n 1 ) 2 T_{n-2} = \displaystyle \sum_{k=1}^{n-1} k = \dfrac {(n-2)(n-1)}2 . Therefore, for n = 2019 n=2019 , T 2017 = 2017 × 2018 2 = 2035153 T_{2017} = \dfrac {2017\times 2018}2 = \boxed{2035153} .


Alternative Solution: After solving a tougher problem Co-ordinates--2 , the following general solution for right triangle with ( 0 , 0 ) (0,0) , ( 0 , n ) (0,n) , and ( m , 0 ) (m,0) as vertices is obtained.

N ( m , n ) = m n m n gcd ( m , n ) 2 + 1 where gcd ( m , n ) is the greatest common divisor of m and n . \begin{aligned} N_\triangle (m,n) & = \frac {mn-m-n-\color{#3D99F6}\gcd(m,n)}2 + 1 & \small \color{#3D99F6} \text{where }\gcd(m,n) \text{ is the greatest common divisor of }m \text{ and }n. \end{aligned}

For m = n m=n , we have N ( n , n ) = n 2 3 n 2 + 1 = ( n 1 ) ( n 2 ) 2 N_\triangle (n,n) = \dfrac {n^2 -3n}2 + 1 = \dfrac {(n-1)(n-2)}2 . The same solution as above.

So its a triangular number! Wow! Nice one. Sir I did like you have a look a bit modified version of this problem and let me know if I am right there.

A Former Brilliant Member - 2 years, 5 months ago
Henry U
Jan 10, 2019

Let's directly do the general formula.

We will use two different methods to calculate the area of the triangle, one of them involves the number of points inside, so we can set both formulas equal to each other and solve this equation.

First, the area of the triangle is simply A 1 = 1 2 b h = 1 2 n 2 A_1 = \frac 12 \cdot b \cdot h = \frac 12 n^2 .

Now, there is another way to calculate this area that involves the number of points inside the triangle. By Pick's theorem , the area is A 2 = I + B 2 1 A_2 = I + \frac B2 -1 where I I is the number of points inside the shape (it works for any shape without holes) and B B is the number of points on the boundary of the shape. We can find B B by counting the number of points on all three sides. There are ( n 1 ) (n-1) on each side, plus the 3 corners, so the area is A 2 = I + 3 + 3 ( n 1 ) 2 1 A_2 = I + \frac {3+3\cdot (n-1)}{2}-1

Since both ways calculate the same area, they must be equal.

A 1 = A 2 1 2 n 2 = I + 3 + 3 ( n 1 ) 2 1 n 2 = 2 I + 3 n 2 2 I = n 2 3 n + 2 I = 1 2 n 2 3 2 + 1 = 1 2 ( n 1 ) ( n 2 ) \begin{aligned} A_1 &= A_2 \\ \frac 12 n^2 &= I + \frac {3+3(n-1)}2-1 \\ n^2 &= 2I + 3n -2 \\ 2I & = n^2-3n+2 \\ I &= \frac 12n^2 - \frac 32 + 1 \\ &= \frac 12 (n-1)(n-2) \end{aligned}

For the specific case of n = 2019 n=2019 , we can calculate I I as 1 2 ( 2019 1 ) ( 2019 2 ) = 2035153 \frac 12 (2019-1)(2019-2) = \boxed{2035153} .

Shouldn't the last step be 1 2 ( n 1 ) ( n 2 ) \frac{1}{2}(n-1)(n-2) ?

Joshua Lowrance - 2 years, 5 months ago

Log in to reply

You're right. Thanks!

Henry U - 2 years, 5 months ago

Bro, can you help me with ( 0 , 0 ) , ( 0 , n ) (0,0),(0,n) and ( m , 0 ) (m, 0) vertices? A bit stuck there:)

A Former Brilliant Member - 2 years, 5 months ago

Log in to reply

Using my strategie, we set 1 2 n m \frac 12nm and I + B 2 1 I + \frac B2 -1 equal to each other. To determine B, we again have the 3 vertices of the triangle plus a side of n n and m m respectively, plus the number of integral points on the hypotenuse, let's say h h . This number is equal to the number of solutions in the positive integers to the linear diophantine equation m y + n x = n m my+nx=nm because every point ( x , y ) (x,y) on the hypotenuse corresponds to exactly one solution.

To find the number of solutions, we use the fact that, if ( x 0 , y 0 ) (x_0,y_0) is a solution, then ( x 0 + t n gcd ( n , m ) , y 0 t m gcd ( n , m ) (x_0+t\frac n{\gcd(n,m)}, y_0-t\frac m{\gcd(n,m)} is also a solution for all integers t t . x 0 x_0 and y 0 y_0 can be taken as x 0 = 0 , y 0 = n x_0=0, y_0=n .
We now have to count the number of t t values such that x x and y y are still positive. For this, we seek the t t that makes y = 0 y=0 .
n t m gcd ( n , m ) = 0 t = n gcd ( n , m ) m n-t\frac m{\gcd(n,m)}=0 \Leftrightarrow t=\frac {n\gcd(n,m)}m . Since this t t makes y = 0 y=0 , the previous integer will be the greatest possible integer, and also the number of solutions, which is therefore h = n gcd ( n , m ) m 1 h = \frac {n\gcd(n,m)}m-1 .

Now, let's solve the equation

1 2 n m = I + 3 + n + m + h 2 1 n m = 2 I + n + m + h + 1 I = 1 2 ( n m + n + m + h + 1 ) = 1 2 ( n m + n + m + n gcd ( n , m ) m 1 + 1 ) = 1 2 ( n m + n + m + n gcd ( n , m ) m ) \begin{aligned} \frac 12 nm &= I + \frac {3+n+m+h}2 -1 \\ nm &= 2I +n+m+h +1 \\ I &= \frac 12(-nm+n+m+h+1) \\ &= \frac 12(-nm+n+m+\frac{n\gcd(n,m)}m-1+1) \\ &= \boxed{\frac 12(-nm+n+m+\frac{n\gcd(n,m)}m)} \end{aligned} .

However, I have no idea if this is right. If you find any mistakes, please correct me.

Henry U - 2 years, 5 months ago

Thank you for your help:)

A Former Brilliant Member - 2 years, 5 months ago

You can check this by taking a case where n = 1 n=1 and m = k m=k where k k is any integer and we do observe that for all these cases the number of integral interior points are 0. 0.

Your formula is a bit confusing. You may check with this general cases.

A Former Brilliant Member - 2 years, 5 months ago

Consider a square having vertices ( 0 , 0 ) , ( 0 , n ) , ( n , 0 ) (0,0) ,(0,n) ,(n, 0) and ( n , n ) (n, n)

Cut it along the diagonal ( n , 0 ) , ( 0 , n ) (n, 0) ,(0,n) , We get our required triangle. Now, we need to find the total number of point inside this triangle. This triangle has a total of 1 2 ( n 1 ) ( n 1 ) = 1 2 ( n 1 ) 2 \dfrac 12 (n-1)(n-1) = \dfrac 12 (n-1)^2 number of points (integral) that lie inside it.

But actually when we observe we have counted the points that lie along the line y = x y=x twice. Hence, we need to remove that extra countings.

Observe that the hypotenuse and y = x y=x meet at ( n 2 , n 2 ) \begin{pmatrix} \dfrac n2 , \dfrac n2 \end{pmatrix} .There are a total of ( n 1 ) (n-1) points between Origin and ( n 2 , n 2 ) \begin{pmatrix} \dfrac n2 , \dfrac n2 \end{pmatrix} .Hence, we need to remove a total of 1 2 ( n 1 ) \dfrac 12(n-1) number of points.

Hence, N n = 1 2 ( n 1 ) 2 1 2 ( n 1 ) = 1 2 ( n 1 ) [ ( n 1 ) 1 ] = 1 2 ( n 1 ) ( n 2 ) N_n = \dfrac 12 (n-1)^2 - \dfrac 12 (n-1) = \dfrac 12(n-1)[(n-1) - 1] = \dfrac 12(n-1)(n-2)

N n = 1 2 ( n 1 ) ( n 2 ) {\color{#20A900}{N_n = \dfrac 12 (n-1)(n-2)}}

So for n = 2019 n = 2019

N 2019 = 1 2 ( 2019 1 ) ( 2019 2 ) = 2035153 N_{2019} = \dfrac 12(2019-1)(2019-2) = \boxed{2035153}

Please correct me if I am wrong.

You're absolutely right! It would be interesting to see your way to get this.

Henry U - 2 years, 5 months ago

Mine one is a bit difficult to explain. I will try anyways. Thanks :)

A Former Brilliant Member - 2 years, 5 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...