Proof. From the given definition, we have a2=2a1+21=2a1+a2+31=127.
We now prove by induction that an≤127, with equality if and only if n=3. The cases n=1,2,3 have been verified. Assume the statement holds for all 1,2,…,n−1 (n≥4), then
an=⌈2n⌉a1+⋯+a⌈2n⌉+n1≤⌈2n⌉0+21+(⌈2n⌉−2)⋅127+n1=127−3⌈2n⌉2+n1=127−3n⋅⌈2n⌉2n−3⌈2n⌉≤127−3n⋅⌈2n⌉2n−3(2n+1)=127−3n⋅⌈2n⌉2n−23<127.
Therefore, the maximum term of the sequence {an} is a3=127. □