# What is the value of the sum: (1^2)+(1^2+2^2)+(1^2+2^2+3^2)+............upto n terms? Thank you!

Nov 24, 2016

$\left({1}^{2}\right) + \left({1}^{2} + {2}^{2}\right) + \ldots + \left({1}^{2} + {2}^{2} + \ldots + {n}^{2}\right) = \frac{n {\left(n + 1\right)}^{2} \left(n + 2\right)}{12}$

#### Explanation:

We will use the following known sums (each of which can be proven via induction):

• ${\sum}_{i = 1}^{n} i = \frac{n \left(n + 1\right)}{2}$
• ${\sum}_{i = 1}^{n} {i}^{2} = \frac{n \left(n + 1\right) \left(2 n + 1\right)}{6}$
• ${\sum}_{i = 1}^{n} \left({i}^{3}\right) = \frac{{n}^{2} {\left(n + 1\right)}^{2}}{4}$

With those:

$\left({1}^{2}\right) + \left({1}^{2} + {2}^{2}\right) + \ldots + \left({1}^{2} + {2}^{2} + \ldots + {n}^{2}\right)$

$= {\sum}_{i = 1}^{n} \left({1}^{2} + {2}^{2} + \ldots + {i}^{2}\right)$

$= {\sum}_{i = 1}^{n} {\sum}_{j = 1}^{i} {j}^{2}$

$= {\sum}_{i = 1}^{n} \frac{i \left(i + 1\right) \left(2 i + 1\right)}{6}$

$= {\sum}_{i = 1}^{n} \frac{2 {i}^{3} + 3 {i}^{2} + i}{6}$

$= {\sum}_{i = 1}^{n} \frac{1}{3} {i}^{3} + {\sum}_{j = 1}^{n} \frac{1}{2} {j}^{2} + {\sum}_{k = 1}^{n} \frac{1}{6} k$

$= \frac{1}{3} {\sum}_{i = 1}^{n} {i}^{3} + \frac{1}{2} {\sum}_{j = 1}^{n} {j}^{2} + \frac{1}{6} {\sum}_{k = 1}^{n} k$

$= \frac{1}{3} \left(\frac{{n}^{2} {\left(n + 1\right)}^{2}}{4}\right) + \frac{1}{2} \left(\frac{n \left(n + 1\right) \left(2 n + 1\right)}{6}\right) + \frac{1}{6} \left(\frac{n \left(n + 1\right)}{2}\right)$

$= \frac{{n}^{2} {\left(n + 1\right)}^{2}}{12} + \frac{n \left(n + 1\right) \left(2 n + 1\right)}{12} + \frac{n \left(n + 1\right)}{12}$

$= \frac{n \left(n + 1\right) \left[n \left(n + 1\right) + \left(2 n + 1\right) + 1\right]}{12}$

$= \frac{n \left(n + 1\right) \left({n}^{2} + 3 n + 2\right)}{12}$

$= \frac{n {\left(n + 1\right)}^{2} \left(n + 2\right)}{12}$