So we have 1280,640,320,...
This is a geometric sequence with the first term,
![a_{1} =1280](https://tex.z-dn.net/?f=%20a_%7B1%7D%20%3D1280)
. To find the common ratio r, we are going to divide any current term by a previous one:
![r= \frac{640}{1280} =(0.5)](https://tex.z-dn.net/?f=r%3D%20%5Cfrac%7B640%7D%7B1280%7D%20%3D%280.5%29)
Remember that the main formula of a geometric sequence is:
![a_{n} = a_{1} r^{n-1}](https://tex.z-dn.net/?f=%20a_%7Bn%7D%20%3D%20a_%7B1%7D%20r%5E%7Bn-1%7D%20)
Where
![a_{n}](https://tex.z-dn.net/?f=%20a_%7Bn%7D%20)
is the nth term (in our case 40),
![a_{1}](https://tex.z-dn.net/?f=%20a_%7B1%7D%20)
is the first term (in our case 1280),
![r](https://tex.z-dn.net/?f=r)
is the common ratio (0.5), and
![n](https://tex.z-dn.net/?f=n)
is the position of the term in the sequence (in our case our weeks)
Now we can replace the values to get:
![40=1280(0.5)^{n-1}](https://tex.z-dn.net/?f=40%3D1280%280.5%29%5E%7Bn-1%7D%20)
![(0.5)^{n-1} = \frac{40}{1280}](https://tex.z-dn.net/?f=%280.5%29%5E%7Bn-1%7D%20%3D%20%5Cfrac%7B40%7D%7B1280%7D%20)
![(0.5)^{n-1} =0.03125](https://tex.z-dn.net/?f=%280.5%29%5E%7Bn-1%7D%20%3D0.03125)
Since our variable, n, is the exponent, we are going to use logarithms to bring it down:
![ln(0.5)^{n-1} =ln(0.03125)](https://tex.z-dn.net/?f=ln%280.5%29%5E%7Bn-1%7D%20%3Dln%280.03125%29)
![(n-1)ln(0.5)=ln(0.03125)](https://tex.z-dn.net/?f=%28n-1%29ln%280.5%29%3Dln%280.03125%29)
The only thing left now is solving for n to find our week:
![n-1= \frac{ln(0.03125)}{ln(0.5)}](https://tex.z-dn.net/?f=n-1%3D%20%5Cfrac%7Bln%280.03125%29%7D%7Bln%280.5%29%7D%20)
![n-1=5](https://tex.z-dn.net/?f=n-1%3D5)
![n=6](https://tex.z-dn.net/?f=n%3D6)
We can conclude that in the sixth week the cafeteria will sell 40 slices of pizza.