I'm trying to find out the remainder when dividing $1+2+3+\dots+3^{100}$ by $5$.
If we were to expand the terms like this: $$ \begin{array}{cccccccccc} 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\ 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20 \end{array} $$
I can see that the sum of every $5$ consecutive terms is divisible by $5$. But I am not sure how to evaluate the whole expression.
The answer in the text book sums the $5$ last terms $$ 3^{100} + (3^{100}-1) + (3^{100}-2) + (3^{100}-3) + (3^{100}-4) = 5 \cdot 3^{100} - 10, $$ and divides that by $5$ in order to find the remainder.
I don't understand how they can deduce that it's sufficient to only take the last $5$ terms? The remainder is $1$, but when I evaluate the sum of $5$ consecutive numbers, I've found the remainder to be $0$ when dividing by $5$.
In order to just evaluate the $5$ last terms, they must somehow know that this property is applicable for all the terms until the five consecutive numbers ending with $3^{100}$. How can they be sure of that?
What I tried was to apply that I know that the sum can be evaluated as: $$ \sum_{i=0}^{n} i = \frac{n(n+1)}{2}, $$ which becomes $$ \sum_{i=0}^{3^{100}} i = \frac{3^{100}(3^{100}+1)}{2}, $$ which I think I could theoretically divide by $5$ and see the remainder, but I can't evaluate that.
The answer is using logic, and I think that is the way to go in order to solve this or similar exercises on a possible exam.