Solution:
We claim that the sequence b1,b2,b3,… defined by bi=2i−1 has this property.
Lemma. If there are no terms aj such that aj−aj−1=1, then aj=aj−1+2 for all j.
Proof. Let c be such that ad=c for some d. Now
a1+a2+⋯+ac=c2.
Equality holds for ai=2i−1 for 1≤i≤c, so if any difference between two consecutive terms is greater, the left-hand side of the equation is greater than c2, a contradiction. □
Lemma. If both d and d+1 are terms of the sequence, i.e. ac=d and ac+1=d+1 for some c, then ad+1=2d+1=bd+1.
Proof. We have a1+a2+⋯+ad=d2 and a1+a2+⋯+ad+1=(d+1)2. Hence ad+1=(d+1)2−d2=2d+1. □
From the observations above, we see that we are done if there are infinitely many gaps of size 1. The only remaining case is one with finitely many gaps of size 1. This will be the subject of the following lemma.
Lemma. If there are only finitely many indices j such that aj+1−aj=1, then there is an index n0 such that for all k>n0, we have ak=2k−1.
Proof. Let r and s be indices such that for all the j satisfying aj+1−aj=1, we have j<r, s. Furthermore, assume s>r and that there are i1 and i2 such that ai1=r and ai2=s. The first goal is to show that as≥2s−1. If ar≥2r−1, this is clearly the case. Assume now ar<2r−1. Now ar≥2r−1−m, where m is the number of indices j with aj+1−aj=1. Denote ar+1=2r+1−m+θ1, ar+2=2r+3−m+θ2, etc. Remember that ar+j+1−ar+j≥2 always. Now 0≤θ1≤θ2≤…. Furthermore, write s=r+h. Now
(r+h)2−r2=ar+1+ar+2+⋯+ar+h=j=1∑h2r−1+2j−m+θj.
From this we deduce
2rh+h2=2rh−h−mh+h(h+1)+j=1∑hθj.
So we obtain ∑j=1hθj=mh. Since the sequence θj is increasing, we have θh≥m. Hence, as=ar+h≥2r−1−m+2h+m=2r+2h−1=2s−1.
Now as is exactly the desired shape. If for any t>s, we have at−at−1>2, then
as+as+1+⋯+at>t2−s2,
again a contradiction.