Even Power of 3 as Sum of Consecutive Positive Integers

Theorem
Take the positive integers and group them in sets such that the $n$th set contains the next $3^n$ positive integers:
 * $\set 1, \set {2, 3, 4}, \set {5, 6, \ldots, 13}, \set {14, 15, \cdots, 40}, \ldots$

Let the $n$th such set be denoted $S_{n - 1}$, that is, letting $S_0 := \set 1$ be considered as the zeroth.

Then the sum of all the elements of $S_n$ is $3^{2 n}$.

Proof
The total number of elements in $S_0, S_1, \ldots, S_r$ is:

Thus for any given $S_n$:
 * $\ds \sum S_n = \sum k \sqbrk {\dfrac {3^n - 1} 2 < k \le \dfrac {3^{n + 1} - 1} 2}$

using Iverson's convention.

So $\ds \sum S_n$ can be evaluated as the difference between two triangular numbers:

Hence the result.