In an arithmetic sequence, consecutive terms differ by a fixed number d :
![a_8=a_7+d](https://img.qammunity.org/2021/formulas/mathematics/high-school/w4u1a2s328nc8qp87y7ainiz4v67pnbjfz.png)
![a_9=a_8+d=a_7+2d](https://img.qammunity.org/2021/formulas/mathematics/high-school/pxdbqkpralzn9rc081rg95uym8jooxxjdj.png)
![a_(10)=a_9+d=a_7+3d](https://img.qammunity.org/2021/formulas/mathematics/high-school/rh0ks8yrk538h7ftonzc6kpfuig1llfltp.png)
and so on up to
![a_(19)=a_7+12d](https://img.qammunity.org/2021/formulas/mathematics/high-school/xuo4gss8z6y8s5ljjf0k0691a4eumkavao.png)
Solve for d :
![140=32+12d\implies12d=108\implies d=9](https://img.qammunity.org/2021/formulas/mathematics/high-school/w88qi235unaz9zjlm9ssa5bg4qrnhcmrdo.png)
Work backwards to find the first term in the sequence, and hence the n-th term:
![a_6=a_7-d](https://img.qammunity.org/2021/formulas/mathematics/high-school/cwkuvlzp58yekiz3g1nvxc6mwr959861js.png)
![a_5=a_6-d=a_7-2d](https://img.qammunity.org/2021/formulas/mathematics/high-school/wyb31dm9ks2abz3oyc2wsn7gup9mnz75eq.png)
and so on down to
![a_1=a_7-6d](https://img.qammunity.org/2021/formulas/mathematics/high-school/pwbf0bgscjx82tvqw04su28ao4jqasyoqg.png)
So the first term is
![a_1=32-6\cdot9=-22](https://img.qammunity.org/2021/formulas/mathematics/high-school/2jmcejo0c9hp406iswcjnjh4pohxjag377.png)
which means the n-th term is
![a_n=a_1+(n-1)d=-22+9(n-1)=9n-31](https://img.qammunity.org/2021/formulas/mathematics/high-school/fvus8xcz3saasohk0m4shlbn4t38ezbnm0.png)
denotes the n-th partial sum of the sequence, i.e. the sum of the first n terms. We want to find the number of terms such that this sum is 511:
![\displaystyle S_n=\sum_(i=1)^na_i=\sum_(i=1)^n(9i-31)=511](https://img.qammunity.org/2021/formulas/mathematics/high-school/nfmntigieqtb8v18q02dt8uvqi0gb9irag.png)
Distribute the summation and recall the formulas,
![\displaystyle\sum_(i=1)^n1=n](https://img.qammunity.org/2021/formulas/mathematics/college/w1cwihd3e4n3yr57b2b8smbb4tm76warbe.png)
![\displaystyle\sum_(i=1)^ni=\frac{n(n+1)}2](https://img.qammunity.org/2021/formulas/mathematics/middle-school/vkghgzckby383xpa4q08zgjyajuazmqao4.png)
![\implies S_n=\displaystyle9\sum_(i=1)^ni-31\sum_(i=1)^n1](https://img.qammunity.org/2021/formulas/mathematics/high-school/7rnfgudpz565exu4bn6x61rggrqoy1zeo2.png)
![\implies511=9\cdot\frac{n(n+1)}2-31n](https://img.qammunity.org/2021/formulas/mathematics/high-school/bahregpma9iqoldu7ir7kk25mrrin1dbk1.png)
![\implies1022=9n^2-53n](https://img.qammunity.org/2021/formulas/mathematics/high-school/rvqe2b0at8wrgupxohvbnrp25h0v6jj01i.png)
![\implies9n^2-53n-1022=0](https://img.qammunity.org/2021/formulas/mathematics/high-school/2uz41tkruioya3nvpncp529qc9ursnop7v.png)
![\implies(n-14)(9n+73)=0](https://img.qammunity.org/2021/formulas/mathematics/high-school/2gexe5m24gyrb267lfxrie1ma30qxe46bh.png)
![\implies n=14\text{ or }n=-\frac{73}9](https://img.qammunity.org/2021/formulas/mathematics/high-school/434dvmss4syml0h31ppz1qco02sdw60ts7.png)
n must be a positive integer, so we the sum is obtained from the first n = 14 terms.