Prove that $1^2+2^2+\cdots+n^2=\frac{n(n+1)(2n+1)}{6}$ for $n \in \mathbb{N}$. Problem: Prove that $1^2+2^2+\cdots+n^2=\frac{n(n+1)(2n+1)}{6}$ for $n \in \mathbb{N}$.
My work: So I think I have to do a proof by induction and I just wanted some help editing my proof.
My attempt:
Let $P(n)=1^2+2^2+\cdots+n^2=\frac{n(n+1)(2n+1)}{6}$ for $n \in \mathbb{N}$. 
Then $$P(1)=1^2=\frac{1(1+1)(2+1)}{6}$$
$$1=\frac{6}{6}.$$
So $P(1)$ is true.
Next suppose that $P(k)=1^2+2^2+\cdots+k^2=\frac{k(k+1)(2k+1)}{6}$ for $k \in \mathbb{N}$. Then adding $(k+1)^2$ to both sides of $P(k)$ we obtain the following:
$$1^2+2^2+\cdots+k^2+(k+1)^2=\frac{k(k+1)(2k+1)}{6}+(k+1)^2$$
$$=\frac{2k^3+3k^2+k+6(k^2+2k+1)}{6}$$
$$=\frac{2k^3+9k^2+13k+6}{6}$$
$$=\frac{(k^2+3k+2)(2k+3)}{6}$$
$$=\frac{(k+1)(k+2)(2k+3)}{6}$$
$$=\frac{(k+1)((k+1)+1)(2(k+1)+1)}{6}$$
$$=P(k+1).$$
Thus $P(k)$ is true for $k \in \mathbb{N}$.
Hence by mathematical induction, $1^2+2^2+\cdots+n^2=\frac{n(n+1)(2n+1)}{6}$ is true for $n \in \mathbb{N}$.

Consider any natural number $r$. You have $$r^3-(r-1)^3=3r^2-3r+1.$$ 
Now telescope it: 
$$
1^3-0^3=3-3+1
$$
$$2^3-1^3=3\cdot2^2-3\cdot2+1
$$
$$\vdots
$$
$$
n^3-(n-1)^3=3n^2-3n+1
$$ Now add, and see them cancel out. You are left with $$n^3=3(1^2+2^2+\cdots+ n^2)-3(1+2+3+\cdots+n)+n$$ You must know 
$$
1+2+3+\cdots+n=\frac{n(n+1)}{2}.
$$ 
Plug it in, and you get the answer. Also, please see that this method works even for $\sum r^4,r^5,\cdots$. I have tried it out. All you need is the sum of its previous powers.
