The given A.P. is 7,14,21,....
Also, Sn=5740
Here, a=7,d=14−7=7
Now, Sn=n2[2a+(n−1)d]
5740=n2[2(7)+(n−1)7]
5740×2=n[14+7n−7]
∴11480=n(7n+7)
∴7n2+7n−11480=0
∴7[n2+n−1640]=0
∴n2+n−1640=0
∴n2+41n−40n−1640=0
∴n(n+41)−40(n+41)=0
∴(n+41)(n−40)=0
∴n+41=0 or n−40=0
∴n=−41 or n=40
But, n cannot be negative
∴n≠−41
∴n=40
∴ The number of terms to be considered are 40.