Maximum number of ones in triangular array of 0's and 1's

36 Views Asked by At

Assume that first row of the triangular array is $a_1, a_2,\dots,a_n$ which only contains 0's and 1's. We will build second row $b_1, b_2,\dots,b_{n-1}$ in this way :

$b_i= a_i\operatorname{XOR} a_{i+1}.$

What is maximum number of ones in this array?

I already knows that answer equals to $\displaystyle \left\lceil{\frac{n(n+1)}{3}}\right\rceil,$ but I can't prove that. I also know it should be solved using induction.