Sequence of Integral Triangles

Geometry Level 5

Consider a sequence T n , n 1 T_n\,,n\geq 1 of all distinct integral triangles.

Distinct triangles means that no two triangles are congruent.

Integral triangle means all the sides of triangle are positive integers.

Let us denote the general term of this sequence as

T n = ( a , b , c ) T_n = (a,b,c) where a b c a \leq b \leq c and a , b , c , n N a,b,c,n \in \mathbb{N} (set of natural numbers)

Here a a will be called as smallest side, b b will be always called as second smallest side no matter b = a b = a for some triangle and c c will be called as largest side.

First term of this sequence is the smallest integral triangle possible which is an equilateral triangle of side length 1 1 .

So, T 1 = ( 1 , 1 , 1 ) \quad T_1 = (1,1,1)

RULES FOR SEQUENCING ALL THE INTEGRAL TRIANGLES

Let T m = ( a m , b m , c m ) T_m = (a_m,b_m,c_m) and T n = ( a n , b n , c n ) T_n = (a_n,b_n,c_n) for some m , n N m,n\in \mathbb{N}

( A ) (A) Triangle with greater perimeter will be placed in the sequence after the triangle with lesser perimeter.

a m + b m + c m < a n + b n + c n m < n a_m + b_m + c_m < a_n + b_n + c_n \Rightarrow m < n

( B ) (B) If perimeter of two triangles are same then triangles will be placed in the increasing order of their smallest side.

\hspace{140pt} If a m + b m + c m = a n + b n + c n \;a_m + b_m + c_m = a_n + b_n + c_n\; then a m < a n m < n \newline\hspace{152pt}a_m < a_n \Rightarrow m < n

( C ) (C) If perimeter and smallest side are same then triangles will be placed in increasing order of second smallest side.

\hspace{140pt} If a m + b m + c m = a n + b n + c n \;a_m + b_m + c_m = a_n + b_n + c_n\; and a m = a n a_m = a_n\; then b m < b n m < n \newline\hspace{152pt} b_m < b_n \Rightarrow m < n

( D ) (D) If all the corresponding sides are same then the triangles are congruent.

\hspace{100pt} If a m + b m + c m = a n + b n + c n \;a_m + b_m + c_m = a_n + b_n + c_n\; , a m = a n a_m = a_n\; and b m = b n c m = c n b_m = b_n\;\Rightarrow c_m = c_n m = n \newline\hspace{100pt}\Rightarrow m = n

For clarity of the rules mentioned above the first few terms of this sequence is shown below :

( 1 , 1 , 1 ) , ( 1 , 2 , 2 ) , ( 2 , 2 , 2 ) , ( 1 , 3 , 3 ) , ( 2 , 2 , 3 ) , ( 2 , 3 , 3 ) , ( 1 , 4 , 4 ) , ( 2 , 3 , 4 ) , ( 3 , 3 , 3 ) \hspace{90pt} (1,1,1), (1,2,2), (2,2,2), (1,3,3), (2,2,3), (2,3,3), (1,4,4), (2,3,4), (3,3,3)

Find T 2020 T_{2020} . If R R and r r are the circum-radius and in-radius respectively of triangle T 2020 T_{2020} . Enter R r Rr .


The answer is 58.

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

Wesley Low
May 27, 2020

Consider a triangle with sides x x , y y and z z where x y z x \leq y \leq z . By the triangle inequality, we know that x + y > z | x + y | > | z | . Given these 2 inequalities, it is apparent that x , y z < x + y x , y \leq z < x + y . Thus we can find the upper and lower limit of perimeter n n of triangles with shortest two sides x x and y y .

The lower limit of n n allowed is when z = y z = y such that n = x + 2 y n = x + 2y and the upper limit is when z = x + y 1 z = x + y - 1 such that n = 2 x + 2 y 1 n = 2x + 2y - 1 , thus giving

x + 2 y n 2 x + 2 y 1 x + 2y \leq n \leq 2x + 2y - 1 x + 1 2 ( n + 1 ) y 1 2 x + 1 2 n -x + \frac{1}{2} \left( n + 1 \right) \leq y \leq -\frac{1}{2} x + \frac{1}{2} n

By considering the ordered pair ( x , y ) \left( x , y \right) as lattice points in a Cartesian coordinate system and the inequalities imposed on a given n n , the question boils down to counting the number of lattice points in the given triangle on the plane defined by the inequalities.


The approach to counting the number of lattice points for a triangle with perimeter p p will be to count how many points the upper limit y = 1 2 x + 1 2 n y = -\frac{1}{2} x + \frac{1}{2} n passes through as n n ranges from 3 to p p and subtracting the number of points the lower limit x + 1 2 ( n + 1 ) = y -x + \frac{1}{2} \left( n + 1 \right) = y passes through as n n ranges from 3 to p 1 p - 1 .

Notice that at n = 3 n = 3 , it passes through 1 lattice point at ( 1 , 1 ) \left(1,1\right) , which corresponds to the ( 1 , 1 , 1 ) \left( 1 , 1 , 1 \right) triangle. Following the line x = 1 x = 1 , the line crosses a lattice point when n n is odd and halfway when n n is even. This corresponds to the constant term incrementing by 1 2 \frac{1}{2} for every increase in n n by 1 1 . The line at x = 2 x = 2 behaves similarly but only starts when n = 6 n = 6 , and so does x = 3 x = 3 when n = 9 n = 9 . This is because the point of intersection between the upper limit and y = x y = x is defined by x = y = n 3 x = y = \frac{n}{3} . Thus the lattice points intersected by the line follows this pattern:

n No. of lattice points 3 1 4 0 5 1 6 01 7 10 8 01 9 101 10 010 11 101 12 0101 \begin{array}{c|l}n & \text{ No. of lattice points} \\ \hline 3 & 1 \\ 4 & 0 \\ 5 & 1 \\ 6 & 01 \\ 7 & 10 \\ 8 & 01 \\ 9 & 101 \\ 10 & 010 \\ 11 & 101 \\ 12 & 0101 \\ \vdots & \vdots \end{array}

where 1 1 denotes a point where the line intersects a lattice point and 0 0 if not, and the digits represent the value of x x (first digit represents x = 1 x=1 , second is x = 2 x=2 , and so on). By summing vertically, the total number of lattice points passed as n n ranges from 3 to p p is

p 2 2 + p 5 2 + + p 2 3 p 2 3 2 \lceil \frac{p-2}{2} \rceil + \lceil \frac{p-5}{2} \rceil + \ldots + \lceil \frac{p-2-3 \lfloor \frac{p-2}{3} \rfloor}{2} \rceil = k = 0 p 2 3 p 2 3 k 2 = \sum\limits_{k=0}^{\lfloor \frac{p-2}{3} \rfloor} \lceil \frac{p-2-3k}{2} \rceil

Using the exact same argument, the number of lattice points passed by the lower limit from n n to p 1 p-1 is

( p 1 ) 2 2 + ( p 1 ) 6 2 + + ( p 1 ) 2 4 ( p 1 ) 2 4 2 \lceil \frac{\left( p-1 \right)-2}{2} \rceil + \lceil \frac{\left( p-1 \right)-6}{2} \rceil + \ldots + \lceil \frac{\left( p-1 \right)-2-4 \lfloor \frac{\left( p-1 \right)-2}{4} \rfloor}{2} \rceil = k = 0 p 3 4 p 3 4 k 2 = \sum\limits_{k=0}^{\lfloor \frac{p-3}{4} \rfloor} \lceil \frac{p-3-4k}{2} \rceil

Thus the total number of lattice points and thus triangles themselves, N ( p ) N \left( p \right) , corresponding to a perimeter p p is given by

N ( p ) = k = 0 p 2 3 p 2 3 k 2 k = 0 p 3 4 p 3 4 k 2 N \left( p \right) = \sum\limits_{k=0}^{\lfloor \frac{p-2}{3} \rfloor} \lceil \frac{p-2-3k}{2} \rceil - \sum\limits_{k=0}^{\lfloor \frac{p-3}{4} \rfloor} \lceil \frac{p-3-4k}{2} \rceil

Using this equation, we can see that the perimeter of T 2020 T_{2020} must have a length of 65, since p = 3 64 N ( p ) = 1991 < 2020 < p = 3 65 N ( p ) = 2087 \sum\limits_{p=3}^{64} N \left( p \right)=1991 < 2020 < \sum\limits_{p=3}^{65} N \left( p \right) = 2087 .


Now that we have narrowed down the triangle corresponding to T 2020 T_{2020} to having a perimeter of 65 65 , we need to consider the order that the lattice points comes in. It is given that the triangles are ordered by smallest side first, followed by second smallest side. Hence the points are ordered first by increasing x x followed by increasing y y . Here we are looking for the position of the 29th point (since 2020 1991 = 29 2020-1991=29 )

Consider the easily proven fact that the upper and lower limits both pass through the point ( 1 , Y ) \left(1,Y\right) , where Y Y is an integer. This means that the line x = 1 x=1 contains only 1 lattice point. The lower limit of y = x + 1 2 ( n + 1 ) y = -x + \frac{1}{2} \left( n+1 \right) decreases by 1 1 for every unit increase in x x , so that the line always intersects a lattice point for integer x x . The upper limit of y = 1 2 ( n x ) y = \frac{1}{2} \left( n-x \right) decreases by only 1 2 \frac{1}{2} for every unit increment in x x , meaning that the vertical distance between the limits increases by 0.5 0.5 for every unit increase in x x .

Since the lower limit always intersects a lattice point for integer x x ,the number of lattice points in the vertical strip of x = X x=X is simply X 2 X n + 1 4 \lceil\frac{X}{2}\rceil\forall X \leq \frac{n+1}{4} , which translates to a pattern of 1 , 1 , 2 , 2 , 3 , 3 , 4 , 4 , 1,1,2,2,3,3,4,4,\ldots . The sum of the first 9 values gives 25 25 while adding the next value gives 30. Hence the point is at ( 10 , 10 + 1 2 ( 65 + 1 ) + ( 4 1 ) ) = ( 10 , 26 ) \left(10,-10 + \frac{1}{2} \left( 65+1 \right) +\left(4-1\right)\right)=\left(10, 26\right) . This, for a triangle with perimeter 65 65 , corresponds to the triplet ( 10 , 26 , 29 ) \boxed{\left(10,26,29\right)} .

Great solution. Thanks for sharing a solution.

Shikhar Srivastava - 1 year ago
Julian Poon
May 30, 2020

Substitute a = k 0 + 2 k 1 + k 2 + 1 b = k 0 + k 1 + k 2 + 1 c = k 1 + k 2 + 1 \begin{aligned} a &= k_0 + 2k_1 + k_2 + 1 \\ b &= k_0 + k_1 + k_2 + 1 \\ c &= k_1 + k_2 + 1 \\ \end{aligned}

Where k 0 , k 1 , k 2 k_0, k_1, k_2 are non-negative integers. This naturally causes a b c a \ge b \ge c and a < b + c a < b+c as per triangle inequality and makes it easy to apply Diophantine methods.

From the method shown here , we can calculate the number of solutions where the perimeter, a + b + c = 2 k 0 + 4 k 1 + 3 k 2 + 3 < n a+b+c = 2k_0 + 4k_1 + 3k_2 + 3< n , and find that a + b + c < 65 a+b+c < 65 has 1991 1991 solutions while a + b + c < 66 a+b+c < 66 has 2087 2087 solutions. Hence T 2020 T_{2020} must have a perimeter of 65 65 . From here it can be done by hand by starting from c = 1 c=1 and going up that c = 10 c=10 and hence ( a , b , c ) = ( 29 , 26 , 10 ) (a,b,c) = (29,26,10) .

Here's the function that generates the number of triangles if the perimeter < n < n , which I'll denote P(n):

\[ P(n)=\begin{cases}
\frac{1}{8}(12k^3 - 6k^2 - (-1)^k + 1) & \text{ if } n-3 \equiv 0 \text{ mod } 6 \\ \frac{1}{2}(3k^3 - k) & \text{ if } n-3 \equiv 1 \text{ mod } 6 \\ \frac{1}{8}(12k^3 + 6k^2 + (-1)^k - 1) & \text{ if } n-3 \equiv 2 \text{ mod } 6 \\ \frac{1}{2}(3k^3 + 3k^2) & \text{ if } n-3 \equiv 3 \text{ mod } 6 \\ \frac{1}{8}(12k^3 + 18k^2 + 8k - (-1)^k + 1) & \text{ if } n-3 \equiv 4\text{ mod } 6 \\ \frac{1}{2}(3(k+1)^3 - 3(k+1)^2) & \text{ if } n-3 \equiv 5 \text{ mod } 6 \end{cases}

\text{ Where } k = \left\lfloor \frac{n-3}{6} \right\rfloor + 1 \]

Another solution will be to use a computer to bruteforce. Here's my 1 line python code:

1
sorted([(a,b,c) for a in range(1,50) for b in range(1,a+1) for c in range(1,b+1) if a < b+c], key=lambda t: (sum(t), t[2], t[1]))[2019]

Julian Poon - 1 year ago

First we have to generalise the number of integral triangles with a specific perimeter.

Let the perimeter of triangle be p p . The sides of triangle be a , b a, b and c c . Then

a + b > c a + b + c > 2 c p > 2 c c < p 2 \hspace{13pt} a + b > c\newline \Rightarrow a + b + c >2c \newline \Rightarrow p > 2c\newline \Rightarrow c < \Large\frac{p}{2}

Similarly, we can get

a < p 2 a < \Large\frac{p}{2} and b < p 2 b < \Large\frac{p}{2}

Since a , b a, b and c c have to be integers. So permissible range of a , b a, b and c c are

1 a p 2 1 \leq a \leq \Large\lceil\frac{p}{2}\rceil 1 1 b p 2 - 1\hspace{50pt}1 \leq b \leq \Large\lceil\frac{p}{2}\rceil 1 1 b p 2 - 1\hspace{50pt}1 \leq b \leq \Large\lceil\frac{p}{2}\rceil 1 - 1

Now let us count number of integer triplets ( a , b , c ) (a,b,c) ignoring the restriction a b c a \leq b \leq c such that

a + b + c = p \hspace{80pt}a + b + c = p

subject to 1 a , b , c p 2 \hspace{25pt}1 \leq a,b,c \leq \Large\lceil\frac{p}{2}\rceil 1 - 1

Let a = x + 1 , b = y + 1 a = x + 1\;,\;b = y + 1 and c = z + 1 c = z + 1 . Then

x + y + z = p 3 \hspace{72pt}x + y + z = p - 3

subject to 0 x , y , z p 2 \hspace{25pt}0 \leq x,y,z \leq \Large\lceil\frac{p}{2}\rceil 2 - 2

Let x + l = p 2 x + l = \Large\lceil\frac{p}{2}\rceil 2 , y + m = p 2 - 2, y + m = \Large\lceil\frac{p}{2}\rceil 2 - 2 and z + n = p 2 z + n = \Large\lceil\frac{p}{2}\rceil 2 - 2 with x , y , z , l , m , n 0 x,y,z,l,m,n \geq 0 . Then

l + m + n = 3 p 2 \hspace{62pt}l + m + n = 3\Large\lceil\frac{p}{2}\rceil p 3 - p - 3

subject to 0 l , m , n [ \hspace{35pt}0 \leq l,m,n\quad[ Right hand side constriant is not needed because it is already fulfilled by the above equation ] ]

This is a familiar system of integer variables.

So, number of ordered triplets ( l , m , n ) (l,m,n) satisfying above conditions is ( 3 p 2 p 1 ) ( 3 p 2 p 2 ) 2 \;\;\Large\frac{\big(3\big\lceil\frac{p}{2}\big\rceil - p - 1\big)\big(3\big\lceil\frac{p}{2}\big\rceil - p - 2\big)}{2} . For each triplet ( l , m , n ) (l,m,n) there exist only one triplet ( x , y , z ) (x,y,z) and for each triplet ( x , y , z ) (x,y,z) there exist only one triplet ( a , b , c ) (a,b,c) . So this is same as number of ordered triplets ( a , b , c ) (a,b,c) .

Let S 0 p S_{0p} denote total number of ordered triplets ( a , b , c ) (a,b,c) satisfying

a + b + c = p \hspace{80pt}a + b + c = p

subject to 1 a , b , c p 2 \hspace{25pt}1 \leq a,b,c \leq \Large\lceil\frac{p}{2}\rceil 1 - 1

Then S 0 p = ( 3 p 2 p 1 ) ( 3 p 2 p 2 ) 2 S_{0p} = \;\;\Large\frac{\big(3\big\lceil\frac{p}{2}\big\rceil - p - 1\big)\big(3\big\lceil\frac{p}{2}\big\rceil - p - 2\big)}{2}

In this S 0 p S_{0p} order of the triplet ( a , b , c ) (a,b,c) is taken into account. For ex- when p = 30 p = 30 , both the triplet ( 5 , 12 , 13 ) (5,12,13) and ( 12 , 5 , 13 ) (12,5,13) is counted. But actually both corresponds to the same triangle. Triplet ( 5 , 12 , 13 ) (5,12,13) is counted 3 ! = 6 3! = 6 times, triplet ( 8 , 11 , 11 ) (8,11,11) is counted 3 ! 2 ! \Large\frac{3!}{2!} = 3 = 3 times and triplet ( 10 , 10 , 10 ) (10,10,10) is counted 1 1 time. So it is not that for determining the number of distinct triangles we can divide S 0 p S_{0p} by a particular number. We have to determine number of triangles of each category counted in S 0 p S_{0p} and then divide them by 6 , 3 , 1 6,3,1 to get the total number of distinct triangles.

Let S 1 p S_{1p} denote the number of triangles counted in S 0 p S_{0p} in which two sides are equal and third side is different.

S 2 p S_{2p} denote the number of triangles counted in S 0 p S_{0p} in which all three sides are equal.

S 3 p S_{3p} denote the number of triangles counted in S 0 p S_{0p} in which all three sides are different.

S p S_p denote the number of distinct triangles counted in S 0 p S_{0p} .

Then definitely, S 0 p = S 1 p + S 2 p + S 3 p \hspace{20pt} S_{0p} = S_{1p} + S_{2p} + S_{3p}

\hspace{35pt} and S p = S 1 p 3 \hspace{30pt}S_p = \Large\frac{S_{1p}}{3} + S 2 p 1 + \Large\frac{S_{2p}}{1} + S 3 p 6 + \Large\frac{S_{3p}}{6}

Calculation of S 1 p \bf S_{1p}

There are three cases : 1. l = m n 2. l m = n 3. l = n m 1.\;l = m \neq n\quad 2.\; l \neq m = n\quad 3.\; l = n \neq m . We will solve for first one.

2 l + n = 3 p 2 \hspace{62pt}2l + n = 3\Large\lceil\frac{p}{2}\rceil p 3 - p - 3

subject to 0 l , n \hspace{35pt}0 \leq l,n

We see that for every l l there exist an n n satisfying above condition. But converse is not always true because for existence of l l , n n should be such that n n and RHS \text{RHS} is of same parity. So for counting we will use the condition on l l .

2 l + n = 3 p 2 \hspace{10pt} 2l + n = 3\Large\lceil\frac{p}{2}\rceil p 3 - p - 3

0 2 l 3 p 2 \Rightarrow 0 \leq 2l \leq 3\Large\lceil\frac{p}{2}\rceil p 3 - p - 3

0 l 3 p 2 p 3 2 \Rightarrow 0 \leq l \leq \Large\frac{3\Big\lceil\frac{p}{2}\Big\rceil - p - 3}{2}

Since l l is to be integer, 0 l 3 p 2 p 3 2 0 \leq l \leq \Large\Bigg\lfloor \frac{3\Big\lceil\frac{p}{2}\Big\rceil - p - 3}{2}\Bigg\rfloor

In this range of l l there might be possibility that n = l n = l which we have to exclude from S 1 p S_{1p} but this will happen only 1 1 time and also only when 3 p 3\; | \;p . For simplifying the ceiling and floor operator we have to take 4 4 cases on p p . And in each case, two subcases whether 3 p 3\;|\;p or 3 ∤ p 3\not|\;p .

If 3 p 3\;|\;p , then S 2 p = 1 S_{2p} = 1 otherwise S 2 p = 0 S_{2p} = 0

Case 1 \bf1 : 4 p 1 & 3 ∤ p 4\;|\;p - 1 \text{ \& } 3\not|\;p

S 0 p = p 2 1 8 S_{0p} = \Large\frac{p^2 - 1}{8}

S 1 p = 3 ( p 1 ) 4 S_{1p} = \Large\frac{3(p - 1)}{4}

S 2 p = 0 S_{2p} = 0

S 3 p = S 0 p S 1 p S 2 p = p 2 1 8 S_{3p} = S_{0p} - S_{1p} - S_{2p} = \Large\frac{p^2 - 1}{8} 3 ( p 1 ) 4 - \Large\frac{3(p - 1)}{4} 0 = ( p 1 ) ( p 5 ) 8 - 0 = \Large\frac{(p - 1)(p - 5)}{8}

S p = S 1 p 3 S_p = \Large\frac{S_{1p}}{3} + S 2 p 1 + \Large\frac{S_{2p}}{1} + S 3 p 6 + \Large\frac{S_{3p}}{6}

S p = p 1 4 \Rightarrow S_p = \Large\frac{p - 1}{4} + ( p 1 ) ( p 5 ) 48 + \Large\frac{(p - 1)(p - 5)}{48}

S p = ( p 1 ) ( p + 7 ) 48 \Rightarrow S_p = \Large\frac{(p - 1)(p + 7)}{48}

Writing direct result for other cases.

Case 2 \bf2 : 4 p 1 & 3 p 4\;|\;p - 1 \text{ \& } 3\;|\;p

S 0 p = p 2 1 8 , S_{0p} = \Large\frac{p^2 - 1}{8}\;\;,\hspace{35pt} S 1 p = 3 ( p 5 ) 4 , S_{1p} = \Large\frac{3(p - 5)}{4}\;\;,\hspace{35pt} S 2 p = 1 , S_{2p} = 1\Large\;\;,\hspace{35pt} S 3 p = p 2 6 p + 21 8 , S_{3p} = \Large\frac{p^2 - 6p + 21}{8}\;\;,\hspace{35pt} S p = ( p + 3 ) 2 48 S_p = \Large\frac{(p + 3)^2}{48}

Case 3 \bf3 : 4 p 2 & 3 ∤ p 4\;|\;p - 2 \text{ \& } 3\not|\;p

S 0 p = ( p 2 ) ( p 4 ) 8 , S_{0p} = \Large\frac{(p - 2)(p - 4)}{8}\;\;,\hspace{35pt} S 1 p = 3 ( p 2 ) 4 , S_{1p} = \Large\frac{3(p - 2)}{4}\;\;,\hspace{35pt} S 2 p = 0 , S_{2p} = 0\Large\;\;,\hspace{35pt} S 3 p = ( p 2 ) ( p 10 ) 8 , S_{3p} = \Large\frac{(p - 2)(p - 10)}{8}\;\;,\hspace{35pt} S p = p 2 4 48 S_p = \Large\frac{p^2 - 4}{48}

Case 4 \bf4 : 4 p 2 & 3 p 4\;|\;p - 2 \text{ \& } 3\;|\;p

S 0 p = ( p 2 ) ( p 4 ) 8 , S_{0p} = \Large\frac{(p - 2)(p - 4)}{8}\;\;,\hspace{35pt} S 1 p = 3 ( p 6 ) 4 , S_{1p} = \Large\frac{3(p - 6)}{4}\;\;,\hspace{35pt} S 2 p = 1 , S_{2p} = 1\Large\;\;,\hspace{35pt} S 3 p = ( p 6 ) 2 8 , S_{3p} = \Large\frac{(p - 6)^2}{8}\;\;,\hspace{35pt} S p = p 2 + 12 48 S_p = \Large\frac{p^2 + 12}{48}

Case 5 \bf5 : 4 p 3 & 3 ∤ p 4\;|\;p - 3 \text{ \& } 3\not|\;p

S 0 p = p 2 1 8 , S_{0p} = \Large\frac{p^2 - 1}{8}\;\;,\hspace{35pt} S 1 p = 3 ( p + 1 ) 4 , S_{1p} = \Large\frac{3(p + 1)}{4}\;\;,\hspace{35pt} S 2 p = 0 , S_{2p} = 0\Large\;\;,\hspace{35pt} S 3 p = ( p + 1 ) ( p 7 ) 8 , S_{3p} = \Large\frac{(p + 1)(p - 7)}{8}\;\;,\hspace{35pt} S p = ( p + 1 ) ( p + 5 ) 48 S_p = \Large\frac{(p + 1)(p + 5)}{48}

Case 6 \bf6 : 4 p 3 & 3 p 4\;|\;p - 3 \text{ \& } 3\;|\;p

S 0 p = p 2 1 8 , S_{0p} = \Large\frac{p^2 - 1}{8}\;\;,\hspace{35pt} S 1 p = 3 ( p 3 ) 4 , S_{1p} = \Large\frac{3(p - 3)}{4}\;\;,\hspace{35pt} S 2 p = 1 , S_{2p} = 1\Large\;\;,\hspace{35pt} S 3 p = ( p 3 ) 2 8 , S_{3p} = \Large\frac{(p - 3)^2}{8}\;\;,\hspace{35pt} S p = ( p + 3 ) 2 + 12 48 S_p = \Large\frac{(p + 3)^2 + 12}{48}

Case 7 \bf7 : 4 p & 3 ∤ p 4\;|\;p \text{ \& } 3\not|\;p

S 0 p = ( p 2 ) ( p 4 ) 8 , S_{0p} = \Large\frac{(p - 2)(p - 4)}{8}\;\;,\hspace{35pt} S 1 p = 3 ( p 4 ) 4 , S_{1p} = \Large\frac{3(p - 4)}{4}\;\;,\hspace{35pt} S 2 p = 0 , S_{2p} = 0\Large\;\;,\hspace{35pt} S 3 p = ( p 4 ) ( p 8 ) 8 , S_{3p} = \Large\frac{(p - 4)(p - 8)}{8}\;\;,\hspace{35pt} S p = p 2 16 48 S_p = \Large\frac{p ^2 - 16}{48}

Case 8 \bf8 : 4 p & 3 p 4\;|\;p \text{ \& } 3\;|\;p

S 0 p = ( p 2 ) ( p 4 ) 8 , S_{0p} = \Large\frac{(p - 2)(p - 4)}{8}\;\;,\hspace{35pt} S 1 p = 3 ( p 8 ) 4 , S_{1p} = \Large\frac{3(p - 8)}{4}\;\;,\hspace{35pt} S 2 p = 1 , S_{2p} = 1\Large\;\;,\hspace{35pt} S 3 p = p 2 12 p + 48 8 , S_{3p} = \Large\frac{p^2 - 12p + 48}{8}\;\;,\hspace{35pt} S p = p 2 48 S_p = \Large\frac{p ^2}{48}

Take a note that \hspace{10pt} Case 2 \bf2 S p = S_p = Case 1 \bf1 S p + 1 3 S_p + \Large\frac{1}{3}

and similarly, \hspace{20pt} Case 4 \bf4 S p = S_p = Case 3 \bf3 S p + 1 3 S_p + \Large\frac{1}{3}

\hspace{72pt} Case 6 \bf6 S p = S_p = Case 5 \bf5 S p + 1 3 S_p + \Large\frac{1}{3}

\hspace{72pt} Case 8 \bf8 S p = S_p = Case 7 \bf7 S p + 1 3 S_p + \Large\frac{1}{3}

For ex - if we have to find S 12 S_{12} it comes in Case 8 8 . So we use the formula given in Case 7 7 putting p = 12 p = 12 and then add 1 3 \Large\frac{1}{3} to get S 12 S_{12} . In general to find any S p S_p we will use the formula considering p p not a multiple of 3 3 and if p p is a multiple of 3 3 we will add 1 3 \Large\frac{1}{3} to it.

Now we have to find the triangle T 2020 T_{2020} . First let us determine the perimeter of triangle T 2020 T_{2020} . Let perimeter of T 2020 T_{2020} be t t . Then we have to find the position where first triangle of perimeter t t is located. So we have to find maximum value of t t such that

S 3 + S 4 + S 5 + + S t 1 + S t 2020 S_3 + S_4 + S_5 + \cdots + S_{t-1} + S_t \leq 2020

Since there is no general term of S p S_p that we can substitute in above equation to get the value of t t , we have to make a group of 4 4 starting from perimeter 3 3 . Since 7 3 mod 4 , 8 4 mod 4 , 9 5 mod 4 , 10 6 mod 4 7\equiv 3\text{ mod }4, 8\equiv 4\text{ mod }4, 9\equiv 5\text{ mod }4, 10\equiv 6\text{ mod }4 . Formula for p = 3 p = 3 and p = 7 p = 7 is almost same just the term 1 3 \Large\frac{1}{3} differ and similarly for others. So we can make a group 3 , 4 , 5 , 6 3,4,5,6 and 7 , 8 , 9 , 10 7,8,9,10 and so on 4 n 1 , 4 n , 4 n + 1 , 4 n + 2 , n 1 4n - 1, 4n, 4n + 1, 4n + 2\;,\,n\geq 1

Take a example of first 4 4 groups : ( 3 , 4 , 5 , 6 ) , ( 7 , 8 , 9 , 10 ) , ( 11 , 12 , 13 , 14 ) (3, 4, 5, 6)\;,\;(7, 8, 9, 10)\;,\;(11, 12, 13, 14) and ( 15 , 16 , 17 , 18 ) (15, 16, 17, 18) .

We can see that in first 3 3 groups, there are 4 4 numbers which are multiple of 3 3 . So if we want to add from S 3 S_3 to S 14 S_{14} we have to add 1 3 \Large\frac{1}{3} , ; 4 ,;4 times. if we want to add from S 3 S_3 to S 18 S_{18} we have to add 1 3 \Large\frac{1}{3} , 6 ,\;6 times. In general, if we want to add first N N groups, if N N is a multiple of 3 3 , we have to add 1 3 \Large\frac{1}{3} , 4 N 3 ,\;4\Big\lfloor\frac{N}{3}\Big\rfloor times. If N mod 3 = 1 N\text{ mod }3 = 1 we have to add 1 3 \Large\frac{1}{3} , 4 N 3 ,\;4\Big\lfloor\frac{N}{3}\Big\rfloor + 2 + 2 times. If N mod 3 = 2 N\text{ mod }3 = 2 we have to add 1 3 \Large\frac{1}{3} , 4 N 3 ,\;4\Big\lfloor\frac{N}{3}\Big\rfloor + 3 + 3 times.

Let Sum ( N ) = n = 1 N ( S 4 n 1 + S 4 n + S 4 n + 1 + S 4 n + 2 ) + 1 3 4 N 3 + ( N mod 3 ) + 1 3 \text{Sum}(N) = \displaystyle\sum_{n = 1}^{N}\Big(S_{4n-1} + S_{4n} + S_{4n+1} + S_{4n+2}\Big) + \frac{1}{3}\cdot4\Bigg\lfloor\frac{N}{3}\Bigg\rfloor + \color{#3D99F6}\frac{(N\text{ mod }3) + 1}{3}

The expression in blue is to be added only when N mod 3 0 N\text{ mod }3\neq 0 . Above expression Sum ( N ) \text{Sum}(N) is the sum of number of distinct triangles with perimeter 3 3 to perimeter 4 N + 2 4N + 2 .

We have to find maximum N N such that Sum ( N ) 2020 \text{Sum}(N) \leq 2020 . After we have found such N N then it will be sure that t t is one of 4 N + 2 , 4 N + 3 , 4 N + 4 , 4 N + 5 4N + 2, 4N + 3, 4N + 4, 4N + 5 . Then it will be easy to determine T 2020 T_{2020} .

Simplifying Sum ( N ) \text{Sum}(N)

S 4 n 1 = 4 n ( 4 n + 4 ) 48 S_{4n - 1} = \Large\frac{4n(4n + 4)}{48} = n ( n + 1 ) 3 = \Large\frac{n(n+1)}{3}

S 4 n = 16 n 2 16 48 S_{4n} = \Large\frac{16n^2 - 16}{48} = n 2 1 3 = \Large\frac{n^2 - 1}{3}

S 4 n + 1 = 4 n ( 4 n + 8 ) 48 S_{4n + 1} = \Large\frac{4n(4n + 8)}{48} = n ( n + 2 ) 3 = \Large\frac{n(n +2)}{3}

S 4 n + 2 = ( 4 n + 2 ) 2 4 48 S_{4n + 2} = \Large\frac{(4n + 2)^2 - 4}{48} = n ( n + 1 ) 3 = \Large\frac{n(n +1)}{3}

Sum ( N ) = n = 1 N ( n ( n + 1 ) 3 + n 2 1 3 + n ( n + 2 ) 3 + n ( n + 1 ) 3 ) + 1 3 4 N 3 + ( N mod 3 ) + 1 3 \text{Sum}(N) = \displaystyle\sum_{n = 1}^{N}\Big(\frac{n(n+1)}{3} + \frac{n^2 - 1}{3} + \frac{n(n +2)}{3} + \frac{n(n +1)}{3}\Big) + \frac{1}{3}\cdot 4\Bigg\lfloor\frac{N}{3}\Bigg\rfloor + \color{#3D99F6}\frac{(N\text{ mod }3) + 1}{3}

Sum ( N ) = 1 3 n = 1 N ( 4 n 2 + 4 n 1 ) + 1 3 4 N 3 + ( N mod 3 ) + 1 3 \Rightarrow\text{Sum}(N) = \displaystyle\frac{1}{3}\sum_{n = 1}^{N}\Big(4n^2 + 4n - 1\Big) + \frac{1}{3}\cdot 4\Bigg\lfloor\frac{N}{3}\Bigg\rfloor + \color{#3D99F6}\frac{(N\text{ mod }3) + 1}{3}

Sum ( N ) = 4 3 n = 1 N n 2 + 4 3 n = 1 N n 1 3 n = 1 N 1 + 1 3 4 N 3 + ( N mod 3 ) + 1 3 \Rightarrow\text{Sum}(N) = \displaystyle\frac{4}{3}\sum_{n = 1}^{N} n^2 + \frac{4}{3}\sum_{n = 1}^{N} n - \frac{1}{3}\sum_{n = 1}^{N} 1 + \frac{1}{3}\cdot 4\Bigg\lfloor\frac{N}{3}\Bigg\rfloor + \color{#3D99F6}\frac{(N\text{ mod }3) + 1}{3}

Sum ( N ) = 2 9 N ( N + 1 ) ( 2 N + 1 ) + 2 3 N ( N + 1 ) N 3 + 1 3 4 N 3 + ( N mod 3 ) + 1 3 \Rightarrow\text{Sum}(N) = \displaystyle\frac{2}{9}\,N(N + 1)(2N + 1) + \frac{2}{3}\,N(N + 1) - \frac{N}{3} + \frac{1}{3}\cdot 4\Bigg\lfloor\frac{N}{3}\Bigg\rfloor + \color{#3D99F6}\frac{(N\text{ mod }3) + 1}{3}

Sum ( N ) = 4 9 N 3 + 4 3 N 2 + 5 9 N + 4 3 N 3 + ( N mod 3 ) + 1 3 \Rightarrow\text{Sum}(N) = \displaystyle\frac{4}{9}\,N^3 + \frac{4}{3}\,N^2 + \frac{5}{9}\,N + \frac{4}{3}\Bigg\lfloor\frac{N}{3}\Bigg\rfloor + \color{#3D99F6}\frac{(N\text{ mod }3) + 1}{3}

Now solving for Sum ( N ) 2020 \text{Sum}(N) \leq 2020

Case A \bf A : N = 3 k , k 1 N = 3k\;,\;k \geq 1

4 9 N 3 + 4 3 N 2 + 5 9 N + 4 9 N 2020 \displaystyle\frac{4}{9}\,N^3 + \frac{4}{3}\,N^2 + \frac{5}{9}\,N + \frac{4}{9}\,N \leq 2020

N ( 4 N 2 + 12 N + 9 ) 9 2020 = 18180 \Rightarrow \displaystyle N(4N^2 + 12N + 9) \leq 9\cdot 2020 = 18180

N ( 2 N + 3 ) 2 18180 \Rightarrow \displaystyle N(2N + 3)^2 \leq 18180

Ignoring 3 3 from 2 N + 3 2N + 3 to get upper bound on N N .

4 N 3 < 18180 \Rightarrow \displaystyle 4N^3 < 18180

N ( 18180 4 ) 1 3 = 16.5645 \Rightarrow \displaystyle N \leq \Big(\frac{18180}{4}\Big)^{\frac{1}{3}} = 16.5645

Since N N is a multiple of 3 3 , on checking for N = 15 N = 15 , we get that N = 15 N = 15 satisfy the equation.

Case B \bf B : N = 3 k + 1 , k 1 N = 3k + 1\;,\;k \geq 1

4 9 N 3 + 4 3 N 2 + 5 9 N + 4 3 ( N 1 3 ) + 2 3 2020 \displaystyle\frac{4}{9}\,N^3 + \frac{4}{3}\,N^2 + \frac{5}{9}\,N + \frac{4}{3}\Big(\frac{N - 1}{3}\Big) + \frac{2}{3} \leq 2020

N ( 2 N + 3 ) 2 18178 \Rightarrow \displaystyle N(2N + 3)^2 \leq 18178

Finding upper bound of N N by ignoring 3 3 .

N < ( 18178 4 ) 1 3 = 16.5639 \Rightarrow \displaystyle N < \Big(\frac{18178}{4}\Big)^{\frac{1}{3}} = 16.5639

Checking for N = 16 N = 16 , we get that it does not satisfy the equation.

Checking for N = 13 N = 13 , we get that it satisfy the equation.

Case C \bf C : N = 3 k + 2 , k 1 N = 3k + 2\;,\;k \geq 1

4 9 N 3 + 4 3 N 2 + 5 9 N + 4 3 ( N 2 3 ) + 3 3 2020 \displaystyle\frac{4}{9}\,N^3 + \frac{4}{3}\,N^2 + \frac{5}{9}\,N + \frac{4}{3}\Big(\frac{N - 2}{3}\Big) + \frac{3}{3} \leq 2020

N ( 2 N + 3 ) 2 18179 \Rightarrow \displaystyle N(2N + 3)^2 \leq 18179

Finding upper bound of N N by ignoring 3 3 .

N ( 18179 4 ) 1 3 = 16.5642 \Rightarrow \displaystyle N \leq \Big(\frac{18179}{4}\Big)^{\frac{1}{3}} = 16.5642

Checking for N = 14 N = 14 , we get that it satisfy the equation.

Maximum value of N N from all the cases is N = 15 N = 15 with Sum ( N ) = 1815 = \text{Sum}(N) = 1815 = number of distinct triangles from perimeter 3 3 to perimeter 4 15 + 2 = 62 4\cdot 15 + 2 = 62 .

So, last triangle with perimeter 62 62 is T 1815 T_{1815} .

Now, S 63 = 16 17 3 + 1 3 = 91 \displaystyle S_{63} = \frac{16\cdot 17}{3} + \frac{1}{3} = 91

1815 + 91 = 1906 < 2020 1815 + 91 = 1906 < 2020

S 64 = 1 6 2 1 3 = 85 \displaystyle S_{64} = \frac{16^2 - 1}{3} = 85

1906 + 85 = 1991 < 2020 1906 + 85 = 1991 < 2020

S 65 = 16 18 3 = 96 \displaystyle S_{65} = \frac{16\cdot 18}{3} = 96

1991 + 96 = 2087 > 2020 1991 + 96 = 2087 > 2020

So, t = 65 t = 65

First triangle of perimeter 65 65 is T 1992 T_{1992} and last triangle triangle of perimeter 65 65 is T 2087 T_{2087}

2020 1992 + 1 = 29 2020 - 1992 + 1 = 29

We have to find the 29 t h 29th triangle of perimeter 65 65 .

Maximum value of any side is 65 2 1 = 32 \displaystyle \Bigg\lceil\frac{65}{2}\Bigg\rceil - 1 = 32

Starting with a = 1 a = 1 , there is only 1 1 triangle that is ( 1 , 32 , 32 ) (1,32,32) .

When a = 2 a = 2 , only 1 1 triangle ( 2 , 31 , 32 ) (2,31,32) .

When a = 3 a = 3 , 2 2 triangles - ( 3 , 30 , 32 ) , ( 3 , 31 , 31 ) (3,30,32), (3,31,31) .

When a = 4 a = 4 , 2 2 triangles - ( 4 , 29 , 32 ) , ( 4 , 30 , 31 ) (4,29,32), (4,30,31) .

and it follows a pattern that when a = 2 b 1 a = 2b - 1 or a = 2 b a = 2b number of triangles for each is b b . But this pattern follows till a = 16 a = 16 . After that when a = 17 , ( 17 , 16 , 32 ) a = 17, (17,16,32) is also counted in b = 9 b = 9 triangles. But this triangle is already counted when a = 16 a = 16 .

1 + 1 + 2 + 2 + 3 + 3 + 4 + 4 + 5 + 5 = 30 1 + 1 + 2 + 2 + 3 + 3 + 4 + 4 + 5 + 5 = 30

Last 5 5 corresponds to a = 10 a = 10 and second last 5 5 corresponds to a = 9 a = 9 . So last triangle with a = 9 a = 9 is 25 t h 25th triangle with perimeter 65 65 . So 29 t h 29th triangle of perimeter 65 65 is 4 t h 4th triangle with a = 10 a = 10 . Writing all 5 5 triangles with a = 10 a = 10 in sequential order.

( 10 , 23 , 32 ) , ( 10 , 24 , 31 ) , ( 10 , 25 , 30 ) , ( 10 , 26 , 29 ) , ( 10 , 27 , 28 ) (10,23,32), (10, 24, 31), (10, 25, 30), (10, 26, 29), (10, 27, 28)

So, 29 t h 29th triangle of perimeter 65 65 is ( 10 , 26 , 29 ) (10,26,29) .

Hence, T 2020 = ( 10 , 26 , 29 ) T_{2020} = (10, 26, 29) . R R and r r are circum-radius and in-radius of T 2020 T_{2020} . We know that

Area of triangle = a b c 4 R = \displaystyle\frac{abc}{4R} where a , b a, b and c c are sides of triangle and R R is its circum-radius.

Also, area of triangle = s r = \displaystyle sr where s s is semiperimeter of triangle and r r is its in-radius.

So, from both the equation we get,

a b c 4 R = s r \displaystyle \frac{abc}{4R} = sr

R r = a b c 4 s \Rightarrow \displaystyle Rr = \frac{abc}{4s}

R r = 10 26 29 2 65 \Rightarrow Rr = \Large\frac{10\cdot 26\cdot 29}{2\cdot 65}

R r = 58 \Rightarrow \displaystyle Rr = 58

P.S. - This is a very long solution so there might be some sort of typing mistake or any mathematical mistake or any other type of error. So please let me know so I can correct it. I have skipped many steps just to reduce the size of solution otherwise it would have been be too long.

great problem. thank you.

Fletcher Mattox - 1 year ago

Log in to reply

Thank you too for solving my problem. You can try my other problems as well.

Shikhar Srivastava - 1 year ago

Log in to reply

Fine problem. Thanks. And here the another problem https://brilliant.org/problems/im-bored-3/

Yuriy Kazakov - 1 year ago

Log in to reply

@Yuriy Kazakov I have seen that problem and tried also. Now I am giving it a second try. I don't know how to calculate P ( n ) P(n) for such large n n . I think programming also doesn't store such large value.

Shikhar Srivastava - 1 year ago

Log in to reply

@Shikhar Srivastava Python is very good helper for such large numbers.

Yuriy Kazakov - 1 year ago

Log in to reply

@Yuriy Kazakov Oh! I know C++. Well I am trying to do by just applying mathematics and small part of programming.

Shikhar Srivastava - 1 year ago

Log in to reply

@Shikhar Srivastava Example Python - find digits sum and length of big number 7^100000.

https://repl.it/ - site for C++, Python and another Language online.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
python

import functools

  def number_sum(n):

        s = [int(digit) for digit in str(n)]

       suma = sum(s)

       print(suma,len(s))

  number_sum(7**100000)

1
2
3
Answer 

379429        84510

Yuriy Kazakov - 1 year ago

Log in to reply

@Yuriy Kazakov Thank you. I am also trying to do it in my own way.

Shikhar Srivastava - 1 year ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...