Let me explain the n(n-1)/2 : )
When you want to sum up a sequence of numbers like {1, 2, 3, 4, 5} you can observe that 1+5 =2+4=3, and as we know the sum of all the elements is equal to the product of average value the elements and the number of elements. The sum of the sequence above is 3*5. A complete graph or clique has an edge between all nodes and so if you have 3 nodes, A, B, C, then you need the edges A-B, A-C, B-C. We will say an edge starts at the lexicographical lower node. In this case A goes to B,C and B goes to C. The graph is undirected but this is only to make the explanation simpler. We can denote this as {2, 1, 0} because A goes to 2 nodes, B goes to 1 node, C goes to 0 nodes. As you can see this is similar to the sequence above. If we have a complete graph with the nodes A->E inclusive then we would get {4, 3, 2, 1, 0}. From what we learned above we can sum this by taking the average, 2, and then multiplying this by the number of elements, 5. We observe that the first value will be the number of nodes minus one (n-1) and that the last value will be 0. Hence the average value will be (n-1)/2. Hence we get (n-1)*n.
I have no idea if that made ANY sense but i like to explain things i think i know to make sure i actually know them. Please share more formulas, i promise i wont explain them 