Solution:
Clearly f(n) is a strictly increasing function, as we can form f(n−1) with n−1 ones, and add the final one. However, we can do better; assume Vishal generates f(n) on the board. After n−2 minutes, there are two numbers left, say they were formed by x ones and y ones, where x+y=n. Clearly the numbers are at most f(x),f(y) (and can be made to be equal to f(x),f(y)), and therefore we obtain
f(n)=x+y=n,1≤x≤y≤n−1max(max(f(x)+f(y),f(x)2))
where we used the fact that f is increasing to get that min(f(x)2,f(y)2)=f(x)2 when x≤y. In particular, f(n+1)≥f(n)+1, and f(2n)≥f(n)2 for all positive integers n.
Upper bound:
First proof of upper bound. We use induction. We can check that f(n)=n for n≤4, and these all satisfy the bound f(n)=n≤3n/3. Assume it is true for all m<n (some n≥5), and with x,y as in equation above we have
f(x)2≤f(⌊2n⌋)2≤(3n/6)2=3n/3
as desired. It thus remains to show that f(x)+f(y)≤3n/3. By induction, it suffices to prove that
3x/3+3y/3≤3(x+y)/3
for 1≤x≤y≤n−1 and x+y=n. This is equivalent to
1+3(y−x)/3≤3y/3
Let w=3(y−x)/3, and we require 3x/3w≥w+1. If x≥2, then this is true as w≥1, and if x=1 then w=3(n−2)/3≥3 and the result is still true. Thus all terms in the equation are at most 3n/3, and so f(n)≤3n/3, and the upper bound is proven.
Second proof of upper bound. Consider a second game with the same rules but in which Vishal can replace a and b by either a+b or ab. Let g(n) be the largest possible value for this new game. Then f(n)≤g(n) because min{a2,b2}≤ab.
We can check g(n)=n for n≤4, so g(n)≤3n/3 for these values. If x and y are both bigger than 1, then g(x)+g(y)≤g(x)g(y). Therefore, for n>4, we have that
g(n)=max{g(n−1)+1,1≤x≤n−1maxg(x)g(n−x)}
Now proceed similarly to the first proof. Assume n>4 and g(m)≤3m/3 for all m<n. If 1≤x≤n−1, then g(x)g(n−x)≤3x/33(n−x)/3=3n/3. And g(n−1)+1≤3(n−1)/3+1, which is shown to be less than 3n/3 in the first proof. It follows that f(n)≤g(n)≤3n/3.
Lower bound:
First proof of lower bound. We begin with a lemma.
Lemma 1. Let m be a nonnegative integer. Then
f(2m)≥22m−1andf(3⋅2m)≥32m
Proof. We prove the lemma by induction. One can check that f(n)=n for n≤3, which proves the lemma for m=0. For a general m>0, we get
f(2m)≥f(2m−1)2≥(22m−2)2=22m−1f(3⋅2m)≥f(3⋅2m−1)2≥(32m−1)2=32m
by induction, as required.
(This lemma can also be proved more constructively. Briefly, if n=2m, then partition the 1's on the board into 2m−1 pairs, and then add each pair to get 2m−1 2's (2=220); then multiply pairs of 2's to get 2m−2 4's (4=221); then multiply pairs of 4's to get 2m−3 16's (16=222); and so on, until there are 2(=21) copies of 22m−2, which then gets replaced with 22m−1. The process is similar for n=3⋅2m, except that the first step is to partition the 1's into 2m groups of 3, and then use addition within each group to get 2m 3's on the board.)
Now assume 2x≤n<3⋅2x−1 for some integer x. Then we have
f(n)≥f(2x)≥22x−1>2n/3
as required. If no such x exists, then there exists an integer x such that 3⋅2x−1≤n<2x+1. In this case, we have
f(n)≥f(3⋅2x−1)≥32x−1>22x+1/3>2n/3
where the second last inequality is equivalent to 2x−1log(3)≥32x+1log(2), and by dividing out 2x and clearing the denominator this is equivalent to 3log(3)≥4log2, which is true as 33=27>16=24.
Second proof of lower bound. We shall prove the stronger result f(n)≥2(n+1)/3 for n≥2 by induction. One can check that f(n)=n for n=2,3,4, which proves the result for these values. Assume that n≥5 and that f(k)≥2(k+1)/3 for all k=2,3,…,n−1. Then
f(n)≥f(⌊n/2⌋)2≥(2(⌊n/2⌋+1)/3)2since ⌊2n⌋≥2=2(2⌊n/2⌋+2)/3≥2(n+1)/3since ⌊2n⌋≥2n−1.
The result follows by induction.