$\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$ Vamos a $\ds{n \equiv 3p + \delta}$ para un número entero $\ds{p}$ donde $\ds{\delta \in \braces{0,1,2}}$ . Entonces,
\begin {align} n^{3} + 2n& = \pars {27p^{3} + 27p^{2} \delta + 9p \delta ^{2} + \delta ^{3}} + \pars {6p + 2 \delta } \\ [3mm]&= \color {#c00000}{ \Large 3} \pars {9p^{3} + 9p^{2} \delta + 3p \delta ^{2} + 2p} + \underbrace { \pars { \delta ^{3} + 2 \delta }} _{ \ds { \in\ \color {#c00000}{ \Large\braces {0,3,12}}}} \end {align}