Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm finding myself getting back into math related stuff for the first time in a while. So please be patient with me.

How does $\frac{(n-i)(n-i+1)}{2}$ expand out to:

$\frac{n^2 - (2i - 1)n - i + i^2}{2}$

If you could show me step by step, I would really appreciate it.

Also, I apologise, but I really didn't know what to tag this with.

share|cite|improve this question
Retagged as (algebra-precalculus). – KReiser Aug 2 '12 at 6:49
up vote 3 down vote accepted

We use the distributive property: $(a+b)c=ac+bc$ and $a(b+c)=ab+ac$.

Step by step, this gives us that

$$\frac{(n-i)(n-i+1)}{2}= \frac{n(n-i+1)-i(n-i+1)}{2}$$

$$\frac{(n-i)(n-i+1)}{2}= \frac{n^2-ni+n-ni+i^2-i}{2}$$

$$\frac{(n-i)(n-i+1)}{2}= \frac{n^2-2ni+n-i^2-i}{2}$$

Now, grouping $n-2ni = -(2i-1)n$, we get that

$$\frac{(n-i)(n-i+1)}{2}= \frac{n^2-(2i-1)n-i^2-i}{2}$$

share|cite|improve this answer
I appreciate the formatting you used. Thank you! – yoonsi Aug 2 '12 at 7:21
You're welcome. Glad I could help. – KReiser Aug 2 '12 at 7:43


share|cite|improve this answer

$$(n-i)(n-i+1) = (n-i)n - (n-i)i + (n-i)$$ $$= n^2 - ni - ni + i^2 + n - i = n^2 - 2ni + n - i = n^2 - n(2i + 1) - i$$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.