For each positive integer $n$ let the set $A_n$ consist of all numbers $\pm 1 \pm 2 \pm ...\pm n$. For example, $$A_1 = \{-1,1\}, A_2 = \{ -3 ,-1 ,1 ,3 \} , A_3 = \{ -6 ,-4 ,-2 ,0 ,2 ,4 ,6 \}.$$Find the number of elements in $A_n$ .
Problem
Source: 2011 Saudi Arabia BMO TST 2.2 - Balkan MO
Tags: algebra, combinatorics, number theory