<s>[INST] Can someone explain the steps of manipulation of this equation for the value of x? 
*

*$x = \sum_{j=1}^{n-1} 5j + 7$

*$x = \left(\sum_{j=0}^{n-1} 5j + 7 \right) - 7$

*$x = \left(5\sum_{j=0}^{n-1} j + \sum_{j=0}^{n-1}7 \right) - 7$

*$x = \left(5\sum_{j=0}^{n-1} j + 7n \right) - 7$

*$x = \frac{5n^2}{2} + 7n - 7$


I follow steps 1 to 3.  
I understand that $\sum_{j=0}^{n-1}$ is equal to $\frac{n^2}{2}$ in steps 4-5 but I don't understand the following:
How does $\sum_{j=0}^{n-1}$ translate to $n$ in step 4 and what happens to $j$?

Update:
I believe that step 5 should be $x = \frac{5n(n-1)}2 + 7n - 7 = \frac 52 n^2 + \frac 92 n -7.$
 [/INST] 4: What do you get if you do $7+7+...+7+7~~ n$ times? $~~7n!$
(from $0 $ to $ n-1$ there are n steps.)
For step 5 you have to write: $$x = \frac{5n^2-5n}{2} + 7n - 7$$
as$$\sum_{j=0}^{n-1} j=\sum_{j=1}^{n-1} j=\sum_{j=1}^{n} j-n=\frac{(n+1)n}{2}-n=\frac{n^2+n-2n}{2}=\frac{n^2-n}{2}$$
</s>