The `n`-th term of geometric progression is `a_n=a_(n-1)r` or more generally

`a_n=a_m r^(n-m)`, `m leq n`. **(1)**

So is you have two elements of geometric progression, this is how you can calculate `r` by using formula (1).

`a_9=a_6r^3`

`160=20r^3`

`r^3=160/20=8`

`r=2`

Now that we have `r` we can use the following formula to calculate the first term `a_1`

`a_n=a_1r^(n-1)` **(2)**

`a_6=a_1r^5`

`20=a_1cdot2^5`

`a_1=20/32=5/8`

Now that we have both `a_1` and `r` we can calculate the sum of the first `n` terms by using the following formula

`S_n=(a_1(r^n-1))/(r-1)`

`S_8=(5/8(2^8-1))/(2-1)=5/8cdot255=1275/8` **<-- Solution**