# How to transform/expand a simple sum to prove equality of two sets?

I have the set $A=\left\{1+\displaystyle\sum_{i=1}^n (3-(-1)^i)\;\text{ where }\;n\in\mathbb{N}_0\right\}$ and I have to prove equality with $B=\{x\in\mathbb{N}\;\text{ where }\;2 \text{ and } 3 \text{ are not factors of }x\}$ and my first thought was to transform the sum to get a function which returns the numerical value $f(n)\in\mathbb{Z}$ based on the parameter $n$. But I don't know which methods i can use to "transform" or "expand" this sum (what is the right term for this kind of operation i want to do by the way?) - any short and hopefully easy description out there?

PS: Mathematica outputs $\displaystyle f(n)=\frac{1}{2}(6 n-(-1)^n+1)+1,n\in\mathbb{N}_0$ as the function i am searching for, but I don't know how to get to this result!

-
Split index $i$ into even and odd. – Sasha Aug 18 '11 at 19:35
@André Nicolas: It is true that $(1-(-1)^n)/2$ has this same property, but what is the way to get to this assumption? – Christian Ivicevic Aug 18 '11 at 19:46
Prooving this one should be not that difficult however it is not clear to me how to develop this term out of the sum of the powers of $-1$. That is the point - i would like to know how you have seen this! – Christian Ivicevic Aug 18 '11 at 20:00
I will first give an answer which is a lie. The sum is a finite geometric progression. Recall that $1+r+\cdots+r^{n-1}=(1-r^{n})/(1-r)$. Put $r=-1$. The true answer is that it is clear that the thing goes $-1,0,-1,0,\dots$, and from experience I know how to manufacture an explicit "formula" for that. – André Nicolas Aug 18 '11 at 20:11
Thanks for these hints. I will try now to check for equality on my own and i will try to understand the manufacturing of this explicit formula :-) – Christian Ivicevic Aug 18 '11 at 20:14

Here is a hint: $$\sum_{i=1}^n ( b + a_i)=(b+a_1)+(b+a_2)+\cdots+(b+a_n)=$$ $$(\underbrace{b+b+\cdots+b}_{n\text{ times}})+(a_1+a_2+\cdots+a_n)=nb+\sum_{i=1}^na_i$$ In your situation, $b=3$, and $a_i=(-1)^{i+1}$ (not $(-1)^i$; do you see why?)
To find a formula for $\displaystyle\sum_{i=1}^n(-1)^{i+1}$, try writing out the first few examples: \begin{align} \sum_{i=1}^0(-1)^{i+1}&=0\\ \sum_{i=1}^1(-1)^{i+1}&=(-1)^{1+1}=1\\ \sum_{i=1}^2(-1)^{i+1}&=(-1)^{1+1}+(-1)^{2+1}=1+(-1)=0\\ \sum_{i=1}^3(-1)^{i+1}&=(-1)^{1+1}+(-1)^{2+1}+(-1)^{3+1}=1+(-1)+1=1\\ \end{align} Do you see the pattern? The comments on the question above explain what's going on here.
To be honest i do not see why you need to use $(-1)^{i+1}$ instead of $(-1)^i$ - the pattern seems clear to me, but the only reason to use $i+1$ seems to be to "heal" the problem to get to this pattern, isn't it that? – Christian Ivicevic Aug 18 '11 at 19:52
The reason why $(-1)^{i+1}$ is the correct expression is that we are subtracting $(-1)^i$ in the statement of the problem. I usually try to convert " $-$ (something)" to " $+$ (something else)", because I find that additions are usually a bit easier to keep track of than subtractions, mentally. Of course, we know that for any $a$, $$-a=(-1)\times a,$$ so $$-(-1)^i=(-1)\times(-1)^i=\underbrace{(-1)\times(-1)\times\cdots\times(-1)}_{i+‌​1\text{ times}}=(-1)^{i+1}.$$ Thus, $$3-(-1)^i=3+(-1)^{i+1},$$ and now we can use the hint I mentioned. – Zev Chonoles Aug 18 '11 at 19:56
@Christian: The change to $i+1$ is fine, but unnecessary. It just enables us to change a $-$ to a $+$. Too many minus signs are a pain. But in this case it makes no difference. – André Nicolas Aug 18 '11 at 19:59