<s>[INST] Can anyone help me with this finite sum? I have to calculate the sum
$\displaystyle\sum_{k=1}^n \displaystyle\frac{3^k}{3^{2k+1}-3^k-3^{k+1}+1}$
We can re-write the sum as follows
$\displaystyle\sum_{k=1}^n \displaystyle\frac{3^k-1+1}{(3^{k+1}-1)(3^k-1)}$
And then we obtain
$\displaystyle\sum_{k=1}^n \displaystyle\frac{1}{3^{k+1}-1}+\displaystyle\sum_{k=1}^n \displaystyle\frac{1}{(3^{k+1}-1)(3^k-1)}$
But I don't know what to do with the last two sums. Can anyone help me with them. Thanks
 [/INST] For such problem, we usually look for some telescoping structure, note that
$$\frac{1}{3^{k} - 1} - \frac{1}{3^{k + 1} - 1} = \frac{2 \times 3^k}{3^{k + 1} - 1)(3^k - 1)}.$$
So based on the decomposition you already found, the summation can be written as
$$\frac{1}{2}\sum_{k = 1}^n \left(\frac{1}{3^{k} - 1} - \frac{1}{3^{k + 1} - 1}\right) = \frac{1}{2}\left(\frac{1}{2} - \frac{1}{3^{n + 1} - 1}\right).$$
</s>