(1) When n=1, we have a12=a13. Since a1=0, we get a1=1.
When n=2, we have (1+a2)2=1+a23. Since a2=0, we get a2=2 or a2=−1.
When n=3, we have (1+a2+a3)2=1+a23+a33. For a2=2, we get a3=3 or a3=−2; for a2=−1, we get a3=1.
In summary, we get three sequences consisting of three terms that satisfy the given condition:
{1,2,3},{1,2,−2}, and {1,−1,1}.
(2) Let Sn=a1+a2+⋯+an. Then we have
Sn2=a13+a23+⋯+an3 (n∈N),(Sn+an+1)2=a13+a23+⋯+an3+an+13.
Finding out the difference of the two expressions above and by an+1=0, we have 2Sn=an+12−an+1.
When n=1, we know from (1) that a1=1.
When n≥2, we have
2an=2(Sn−Sn−1)=(an+12−an+1)−(an2−an).
And that is
(an+1+an)(an+1−an−1)=0.
Then we get an+1=−an or an+1=an+1.
Finally, from a1=1 and a2013=−2012, we find the formula of general term for a required sequence as
an={n,2012(−1)n,1≤n≤2012,n≥2013.