We have arithmetic progression with the first term = 4 and the common difference d = 3.
The number of terms, n, is unknown.
The formula for the sum of the first n terms of any AP is
= .
Thus we have an equation
= 531 ====>
(8 + 3*(n-1))*n = 1062 ====>
3n^2 + 5n - 1062 = 0 ====>
= = .
Only positive root makes sense: n = = 18.
Answer. n = 18, or 18 terms.