Given the first n terms of the sequence {an} and Sn = N2, we can find the general term formula of the sequence

Given the first n terms of the sequence {an} and Sn = N2, we can find the general term formula of the sequence

a1=S1=1^2=1
Sn=n^2
Sn-1=(n-1)^2
an=Sn-Sn-1
=n^2-(n-1)^2
=2n-1
When n = 1, 2N-1 = 1, also satisfy
The general formula of sequence {an} is an = 2N-1