## IMC 2017 – Day 2 – Solutions

See the previous post for the statements of the problems.

**Problem 6.** We have that

Suppose for . Then for we have

This shows that . In the same way, having for leads to .

Now all we need to do is to apply the above procedure to inequalities of the form for and for , which come from the definition of the limit when . The case infinite is similar.

**Problem 7.** If all roots of are real then the sum of their square is non-negative. Suppose is a polynomial of degree . If we denote are the roots of then

If then the previous inequality translates to

which is equivalent to . Now if we compute the coefficients for we find something which for contradicts the previous inequality.

**Problem 8.** We start by observing that the eigenvalues of are and . Next, using the properties of block matrix determinants, we have the following equalities

The block determinant formula holds if is invertible. This happens for all but finitely many values of (the eigenvalues of ). Moreover, since the above equalities are polynomial equalities, this implies equality for every . Therefore, for each eigenvalue of (multiplicity accounted) we have and as eigenvalues for .

Therefore the eigenvalues of are

Note that a phenomenon similar to the Pascal triangle appears, which makes that adjacent eigenvalues of (which have a difference equal to ) with multiplicities and generate an eigenvalue of with multiplicity

**Problem 9.** Elementary techniques in ODE show that . We note that and . Therefore on . This implies, using a recurrence argument, that . This shows that exists for , but, for now, might be infinite.

In order to find an upper bound we may look what is the equation satisfied by an eventual limit of as . We arrive at the ODE . It is immediate to see that . Now we would like to prove that on , and for this we define . Using and the hypothesis we get . Using this we have

and . This implies that

This implies easily that on , which means that on . Thus the pointwise limit of exists. Let’s denote it by . Since using the monotone convergence theorem we have the convergence of integrals . Thus the limit satisfies

Therefore satisfies and which means that the limit is indeed for .

## IMC 2017 – Day 2 – Problems

**Problem 6.** Let be a continuous function such that exists (finite or infinite).

Prove that

**Problem 7.** Let be a nonconstant polynomial with real coefficients. For every positive integer let

Prove that there are only finitely many numbers such that all roots of are real.

**Problem 8.** Define the sequence of matrices by the following recurrence

where is the identity matrix.

Prove that has distinct integer eigenvalues with multiplicities , respectively.

**Problem 9.** Define the sequence of continuously differentiable functions by the following recurrence

Show that exists for every and determine the limit function.

**Problem 10.** Let be an equilateral triangle in the plane. Prove that for every there exists an with the following property: If is a positive integer and are non-overlapping triangles inside such that each of them is homothetic to with a negative ratio and

then

## IMC 2017 – Day 1

**Problem 1.** Determine all complex numbers for which there exists a positive integer and a real matrix such that and is an eigenvalue of .

**Problem 2.** Let be a differentiable function and suppose that there exists a constant such that

for all . Prove that

holds for all .

**Problem 3.** For any positive integer denote by the product of positive divisors of . For every positive integer define the sequence

Determine whether for every set there exists a positive integer such that the following condition is satisfied:

*For every with the number is a perfect square if and only if .*

**Problem 4.** There are people in a city and each of them has exactly friends (friendship is mutual). Prove that it is possible to select a group of people such that at least persons in have exactly two friends in .

**Problem 5.** Let and be positive integers with and let

be a polynomial with complex coefficients such that

Prove that and have at most common roots.

## Project Euler – Problem 264

Today I managed to solve problem 264 from Project Euler. This is my highest rating problem until now: 85%. You can click the link for the full text of the problem. The main idea is to find all triangles ABC with vertices having integer coordinates such that

- the circumcenter O of each of the triangles is the origin
- the orthocenter H (the intersection of the heights) is the point of coordinates (0,5)
- the perimeter is lower than a certain bound

I will not give detailed advice or codes. You can already find a program online for this problem (I won’t tell you where) and it can serve to verify the final code, before going for the final result. Anyway, following the hints below may help you get to a solution.

The initial idea has to do with a geometric relation linking the points A, B, C, O and H. Anyone who did some problems with vectors and triangles should have come across the needed relation at some time. If not, just search for important lines in triangles, especially the line passing through O and H (and another important point).

Once you find this vectorial relation, it is possible to translate it in coordinates. The fact that points A, B, C are on a circle centered in O shows that their coordinates satisfy an equation of the form , where is a positive integer, not necessarily a square… It is possible to enumerate all solutions to the following equation for fixed , simply by looping over and . This helps you find all lattice points on the circle of radius .

Once these lattice points are found one needs to check the orthocenter condition. The relations are pretty simple and in the end we have two conditions to check for the sum of the x and y coordinates. The testing procedure is a triple loop. We initially have a list of points on a circle, from the previous step. We loop over them such that we dont count triangles twice: i from 1 to m, j from i+1 to m, k from j+1 to m, etc. Once a suitable solution is found, we compute the perimeter using the classical distance formula between two points given in coordinates. Once the perimeter is computed we add it to the total.

Since the triple loop has cubic complexity, one could turn it in a double loop. Loop over pairs and construct the third point using the orthocenter condition. Then just check if the point is also on the circle. I didn’t manage to make this double loop without overcounting things, so I use it as a test: use double loops to check every family of points on a given circle. If you find something then use a triple loop to count it properly. It turns out that cases where the triple loop is needed are quite rare.

So now you have the ingredients to check if on a circle of given radius there are triangles with the desired properties. Now we just iterate over the square of the radius. The problem is to find the proper upper bound for this radius in order to get all the triangles with perimeter below the bound. It turns out that a simple observation can get you close to a near optimal bound. Since in the end the radii get really large and the size of the triangles gets really large, the segment OH becomes small, being of fixed length 5. When OH is very small, the triangle is almost equilateral. Just use the upper bound for the radius for an equilateral triangle of perimeter equal to the upper bound of 100000 given in the problem.

Using these ideas you can build a bruteforce algorithm. Plotting the values of the radii which give valid triangles will help you find that you only need to loop over a small part of the radii values. Factoring these values will help you reduce even more the search space. I managed to solve the problem in about 5 hours in Pari GP. This means things could be improved. However, having an algorithm which can give the result in “reasonable” time is fine by me.

I hope this will help you get towards the result.

## Project Euler 607

If you like solving Project Euler problems you should try Problem number 607. It’s not very hard, as it can be reduced to a small optimization problem. The idea is to find a path which minimizes time, knowing that certain regions correspond to different speeds. A precise statement of the result can be found on the official page. Here’s an image of the path which realizes the shortest time:

## Balkan Mathematical Olympiad 2017 – Problems

**Problem 1.** Find all ordered pairs of positive integers such that:

**Problem 2.** Consider an acute-angled triangle with and let be its circumscribed circle. Let and be the tangents to the circle at points and , respectively, and let be their intersection. The straight line passing through the point and parallel to intersects in point . The straight line passing through the point and parallel to intersects in point . The circumcircle of the triangle intersects in , where is located between and . The circumcircle of the triangle intersects the line (or its extension) in , where is located between and .

Prove that , , and are concurrent.

**Problem 3.** Let denote the set of positive integers. Find all functions such that

for all

**Problem 4.** On a circular table sit students. First, each student has just one candy. At each step, each student chooses one of the following actions:

- (A) Gives a candy to the student sitting on his left or to the student sitting on his right.
- (B) Separates all its candies in two, possibly empty, sets and gives one set to the student sitting on his left and the other to the student sitting on his right.

At each step, students perform the actions they have chosen at the same time. A distribution of candy is called legitimate if it can occur after a finite number of steps. Find the number of legitimate distributions.

(Two distributions are different if there is a student who has a different number of candy in each of these distributions.)

Source: AoPS