In above A.P. a = 24 and d = -3.
We know that,
S = 2n(2a+(n−1)d)
Let sum of n terms be 78.
⇒78=2n(2×24+(n−1)(−3))⇒78=2n(48−3n+3)⇒78×2=n(51−3n)⇒156=51n−3n2⇒3n2−51n+156=0⇒3(n2−17n+52)=0⇒n2−17n+52=0⇒n2−13n−4n+52=0⇒n(n−13)−4(n−13)=0⇒(n−4)(n−13)=0⇒n−4=0 or n−13=0⇒n=4,13.
Hence, no. of terms = 4 or 13.