MathLabs

Problem 5

Let nn be a positive integer. A Japanese triangle consists of 1+2+⋯+n1+2+\cdots+n circles arranged in an equilateral triangular shape such that for each i=1,2,…,ni=1,2,\ldots,n, the ii-th row contains exactly ii circles, exactly one of which is colored red. A ninja path in a Japanese triangle is a sequence of nn circles obtained by starting in the top row, then repeatedly going from a circle to one of the two circles immediately below it, and finishing in the bottom row. In terms of nn, find the greatest kk such that in each Japanese triangle there is a ninja path containing at least kk red circles.
Step 5 of 5: Solve the recurrence to finish
In plain words

Unrolling the recurrence shows the row total grows by roughly a full unit of average value every time the row index doubles, which is precisely the mechanism that produces a logarithmic guarantee.

Sn≥cn+2r+1 for n=2c+r, 0≤r<2c  ⟹  max⁡if(i,n)≥c+1S_n\ge cn+2r+1\ \text{for}\ n=2^c+r,\ 0\le r<2^c\implies\max_if(i,n)\ge c+1
Detailed analysis

Writing n=2c+rn=2^c+r with 0≤r<2c0\le r<2^c, induction on nn using the recurrence of Step 4 shows Sn≥cn+2r+1S_n\ge cn+2r+1 (the inductive step splits into whether n+1n+1 is a power of 22 or not, both cases closing the induction cleanly). Dividing by nn, Sn/n≥c+(2r+1)/n>cS_n/n\ge c+(2r+1)/n>c, and since some entry of row nn is at least the average Sn/nS_n/n, that entry is at least c+1=⌊log⁡2n⌋+1c+1=\lfloor\log_2n\rfloor+1. Hence every Japanese triangle has a ninja path with at least ⌊log⁡2n⌋+1\lfloor\log_2n\rfloor+1 red circles, matching the construction of Step 2 and proving k=⌊log⁡2n⌋+1k=\lfloor\log_2n\rfloor+1.