# The numbers on blackboard

The numbers $$2020,2019,2018,...,1$$ are written on the blackboard from left to right.

John repeats the following process until there is only one number left:

John chooses the first two numbers from the left, namely $$a,b$$, and replaces them by $$\frac{\sqrt{a^2+3ab+b^2-2a-2b+4}}{ab+4}$$, which is written on the left of all other numbers.

What is the remaining number?

Source: HK Prelim 2010 Q19(Numbers changed)

• Should this have the [no-computers] tag? – Gareth McCaughan Jun 20 at 14:09

Let $$f(a,b) := \frac{\sqrt{a^2+3ab+b^2-2a-2b+4}}{ab+4}.$$

John's procedure is now to repeatedly replace the leftmost two values $$a,b$$ on the blackboard by the single value $$f(a,b)$$.

I claim that John never writes a negative value onto the blackboard.

Proof: the blackboard always begins with positive values. Suppose $$a$$ and $$b$$ are positive values John erases. Then $$\sqrt{a^2+3ab+b^2-2a-2b+4} = \sqrt{(a-1)^2+(b-1)^2 + 3ab + 2}$$ is also positive, as well as $$ab+4$$. So the new blackboard value $$f(a,b)$$ is also positive.

Suppose John does his thing until there are only three values left on the blackboard: $$x, 2, 1$$.

Then after the next step, the two remaining numbers will be $$f(x,2)$$ and $$1$$.

Let's compute $$f(x,2)$$:

$$f(x,2) = \frac{\sqrt{x^2+6x+4-2x-4+4}}{2x+4} = \frac{\sqrt{x^2+4x+4}}{2x+4} =\frac{|x+2|}{2x+4} = \frac 12.$$

After that step, the board contains $$\frac 12$$ and $$1$$.

The final number on the board is therefore $$f\left(\frac 12,1\right) = \frac{\sqrt{\frac 14 + 3\cdot\frac 12 + 1 - 1 - 2 + 4}}{\frac 12 + 4} = \frac{\sqrt {\frac{15}4}}{\frac 92} = \frac{\sqrt {15}}9.$$

• That's quite neat. – hexomino Jun 20 at 17:51
• Damn I missed the wording that the result is placed on the left and reused, so I didn't know what to do with f(a,2) = 1/2. Enjoy your rep :) – ghosts_in_the_code Jun 20 at 18:08
• Correct! This is the solution! – Culver Kwan Jun 21 at 0:11