write an explicit formula for the sum $\sum_{i=1}^n {(3i+1)}$ I've been shown that  :
$$\sum_{i=1}^n i = \frac{n(n+1)}{2}$$
Now I need to write an explicit formula for the sum:
$$\sum_{i=1}^n {(3i+1)}$$
I've come up with an answer that is: 
$$\sum_{i=1}^n  {(3i+1)} = \frac{9n^2 + 6n + 3}{2}$$ 
However I am not sure if this is right or not. Thanks in advance for any help. 
 A: $$
\sum_{i=1}^n(3i+1)=3\sum_{i=1}^n i+\sum_{i=1}^n 1=\dots
$$
A: $$\sum_{i=1}^{n}(3i+1) = 3\sum_{i=1}^{n}i + \sum_{i=1}^{n}1 =\\  3\frac{n(n+1)}{2} + n = \frac{3n^2+5n}{2}$$
A: There is a trick that sometimes make some problems easy to attack:
$$\sum_{i=1}^nf(i)=f(1)+\cdots+f(n)=f(n)+\cdots+f(1)=\sum_{i=1}^nf(n+1-i).$$
In this case $f(i)=3i+1$, so we get
$$
\begin{align}
\sum_{i=1}^n {(3i+1)}&=\frac{1}{2}\left(\sum_{i=1}^n {(3i+1)}+\sum_{i=1}^n {(3(n+1-i)+1)} \right)\\
&=\frac{1}{2}\sum_{i=1}^n {\left((3i+1)+(3(n+1-i)+1)\right)}\\
&=\frac{1}{2}\sum_{i=1}^n {(3n+5)}\\
&=\frac{n(3n+5)}{2}.
\end{align}
$$
A: Of course, egreg has outlined the optimal way of obtaining your closed-form expression, but if you are learning about sequences and series, then I imagine the "intended" solution was via the $n$th partial sum for arithmetic sequences, namely $S_n=\frac{n(a+a_n)}{2}$, where $a_n$ is the $n$th term ($a_n=a+(n-1)d$, where $d$ is the common difference) and $a$ the first time. Using the information you have given, it is clear that $a=4$ and $a_n=4+(n-1)3=1+3n$. Hence,
$$
S_n=\frac{n[4+(1+3n)]}{2}=\frac{n(5+3n)}{2}=\frac{3n^2+5n}{2},
$$
confirming the "slicker" answers provided by others already.
