Suppose there exists i∈{1,2,…,n} for which ai=0. Clearly ai+1=0, and consequently a1=a2=⋯=an=0.
Suppose now that ai=0 for all i∈{1,2,…,n}. Choose p,q∈{1,2,…,n} such that aq≤ai≤ap for all i∈{1,2,…,n}.
Now ap3=ap+12+ap+22+ap+32≤3ap2 and aq3=aq+12+aq+22+aq+32≥3aq2 yield ap≤3≤aq, therefore a1=a2=⋯=an=3.