Question 1190223
.
a besieged fortress is held by 5700 men who have provisions for 66 days. 
of the garrison loses 20 men each day, for how many days will be provisions last?
~~~~~~~~~~~~~~


<pre>
There are 5700*66 portions of provision in the storage.


In the 1st day, 5700 portions are consumed.

In the 2nd day, 5700-20 = 5680 portions are consumed.

In the 3nd day, 5680-20 = 5660 portions are consumed.

. . . and so on . . . 


The problem wants you find the sum of the first n terms of this arithmetic progression

    {{{S[n]}}} = {{{sum(a[k], k=1,n)}}}


and the number n in such a way that {{{S[n]}}} = 5700*66, under an additional condition {{{a[n]}}} >= 0.


The first term of this AP is 5700; the common difference is -20,  so the sum of the first n terms is

    {{{S[n]}}} = {{{((2*a[1] - d*(n-1))/2)*n}}} = {{{((2*5700-20*(n-1))/2)*n}}} = {{{((11420-20n)/2)*n}}}.


So we write this equation

    {{{((11420-20n)/2)*n}}} = 5700*66


Simplify 

    20n^2 - 11420n + 11400*66 = 0

      n^2 - 571 + 5700*66 = 0.


Next, apply the quadratic formula.  You will get

      {{{n[1,2]}}} = {{{(571 +- 419)/2}}}.


The value {{{n[1]}}} = {{{(571-419)/2}}} = 76 works: it satisfies {{{S[n]}}} = {{{S[76]}}} = 5700*66 and {{{a[n]}}} >= 0.


The other value {{{n[2]}}} = {{{(571+419)/2}}} = 495 does not work: {{{a[495]}}} = 5700-20*495 = -4200 is negative.


So, the problem is just solved, and the  <U>ANSWER</U>  is 76 days.
</pre>

Solved.


To check, I created an MS Excel spreadsheet, generated this AP there and calculated its sum.


The check confirmed that the answer is correct.