<s>[INST] Prove that $(n^3 - 1)n^3(n^3 + 1)$ is divisible by $504$ How to prove that $(n^3 - 1)n^3(n^3 + 1)$ is divisible by $504$? Factoring $504$ yields $2^3 \cdot 3^2 \cdot 7$. Divisibility by $8$ can be easily seen, because if $n$ is even then $8 | n^3$, else $(n^3 - 1)$ and $(n^3 + 1)$ are both even and one of these is divisible by $4$ so $8|(n^3 - 1)(n^3 + 1)$. I'm stuck at proving divisibility by $9$ and $7$
 [/INST] For 9: if $n$ is divisible by 3, then the conclusion is obvious. If $n \equiv 1 \bmod 3$, then $n^3 \equiv 1 \bmod 9$ (proof: write $n^3 = (3k+1)^3 = 27k^3 + 27k^2 + 9k + 1$; all terms but the constant are killed modulo 9). If $n \equiv -1 \bmod 3$, then $n^3 \equiv -1 \bmod 9$ (proof is similar).
For 7, the conclusion follows from arberavdullahu's comment about cubic residues. If you'd rather it be more explicit: let $m \in \{0, \ldots, 6\}$ be such that $m \equiv n \bmod 7$; then $n^3 = (7k+m)^3 = 343k^3 + 147 k^2 m + 21km^2 + m^3$; all terms but $m^3$ die modulo 7, so you just have to check that all of $0^3, \ldots, 6^3$ are congruent to one of $-1, 0, 1$. In general, though, $n^p \equiv m^p \mod r$ as long as $n \equiv m \mod r$, so this step is easy (the mod-9 step, where we had to move from mod-3 considerations to mod-9, was a bit harder).
</s>