# 1+2+3+…(n-1)=n(n-1)/2

Each unordered pair of green balls corresponds uniquely with a blue one. So the set of pairs of green balls has the same order as the set of blue balls. Since $\tbinom{5}{2}$ pairs are possible and the blue balls are $1+2+3+4$ in number so $1+2+3+4 = \tbinom{5}{2}=5(5-1)/2$