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 $$n = \frac {r \left({r+1}\right)} 2$$ from Closed Form for Triangular Numbers.

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

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


 * Let $$r \equiv 0 \pmod 3$$.

Then $$r \left({r+1}\right) \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 \left({r+1}\right) \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 \left({r+1}\right) = \left({3 k + 1}\right) \left({3 k + 2}\right)$$

$$ $$ $$

So $$T_r = 9 \frac {k \left({k + 1}\right)} 2 + 1$$.

Thus $$T_r \equiv 1 \pmod 9$$.