I got this math "riddle" in one of my math test, and I would love to know how to solve it.
If $$S = 1 + 2 + 3 + 4 + \ldots + 2015,$$ then a sum of $$1 + 2 + 3 + \ldots + 2015 + 2016 + \ldots + 4030$$ is equal to: ?
I know the answer is $2S + 2015^2$, but not how to get it. Could someone explain, please?
$$ \begin{align} &1+2+\cdots+2015+2016+\cdots+4030\\ =\:&S+(2015+1)+(2015+2)+\cdots+(2015+2015)\\ =\:&S+(1+2+\cdots+2015)+(\underbrace{2015+2015+\cdots+2015}_{2015\text{ times}})\\ =\:&S+S+2015\cdot2015\\ =\:&2S+2015^2 \end{align} $$ If you want to find the value of $S$, you can do the following additional pairing: $$ \begin{align} S&=1+2+\cdots+2015\\ &=(2015+1)+(2014+2)+\cdots+(1009+1007)+1008\\ &=\underbrace{2016+2016+\cdots+2016}_{1007\text{ times}}+1008\\ &=1007\cdot2016+1008\\ &=2\,031\,120 \end{align} $$