Triangular Number Modulo 3 and 9

Theorem
Let $n$ be a triangular number.

Then one of the following two conditions applies:
 * $n \equiv 0 \pmod 3$
 * $n \equiv 1 \pmod 9$

Proof
Let $n = T_r$.

Then from Closed Form for Triangular Numbers:
 * $n = \dfrac {r \paren {r + 1} } 2$

It suffices from Euclid's Lemma to investigate the nature of $r \paren {r + 1}$ modulo $3$.

There are three cases to consider:
 * $r \equiv 0 \pmod 3$
 * $r \equiv 1 \pmod 3$
 * $r \equiv 2 \pmod 3$

Let $r \equiv 0 \pmod 3$.

Then:
 * $r \paren {r + 1} \equiv 0 \pmod 3$

and so $T_r \equiv 0 \pmod 3$.

Let $r \equiv 2 \pmod 3$.

Then:
 * $r + 1 \equiv 3 \equiv 0 \pmod 3$

So:
 * $r \paren {r + 1} \equiv 0 \pmod 3$

and so $T_r \equiv 0 \pmod 3$.

Let $r \equiv 1 \pmod 3$.

Then $\exists k \in \Z: r = 3 k + 1$.

So $r \paren {r + 1} = \paren {3 k + 1} \paren {3 k + 2}$

So:
 * $T_r = 9 \dfrac {k \paren {k + 1} } 2 + 1$

Thus $T_r \equiv 1 \pmod 9$.