Prove that $9$ divides $n^3 + (n+1)^3 + (n+2)^3$ where $n$ is a nonnegative integer.
I have seen many questions on this site that contain the answer to this problem and I already know the solution, but I have yet to find offer a clear explanation that I am able to understand. Can somebody please go through this problem and explain step by step as if talking to an elementary school student how it is solved?
I can get this far:
First, show that this is true for n=0: $0^3+(0+1)^3+(0+2)^3=9$
Second, assume that this is true for n: $n^3+(n+1)^3+(n+2)^3=9k$
Third, prove that this is true for n+1: $(n+1)^3+(n+2)^3+(n+3)^3= 9k−n^3+(n+3)^3=$
This is the part that I get lost. Where do we get 9k-n3+(n+3)3? Why wouldn't it just be 9k?
Many thanks in advance for your generous help!
$\underline{\text{Proof by induction:}}$
First, show that this is true for $n=0$:
$0^3+(0+1)^3+(0+2)^3=9$
Second, assume that this is true for $n$:
$n^3+(n+1)^3+(n+2)^3=9k$
Third, prove that this is true for $n+1$:
$\color{red}{(n+1)^3+(n+2)^3}+(n+3)^3=$
$\color{red}{9k-n^3}+(n+3)^3=$
$9k-n^3+n^3+9n^2+27n+27=$
$9k+9n^2+27n+27=$
$9(k+n^2+3n+3)$
Please note that the assumption is used only in the part marked red.
$\underline{\text{Proof by modular-arithmetic:}}$
Consider the following cases:
Please note that this method is handy only when dealing with a relatively small divisor.