I have run into trouble with an exercise in Szabo and Ostlund's Modern Quantum ChemistrySzabo and Ostlund's Modern Quantum Chemistry.
Exercise 3.14: Assume the basis functions are real and use the symmetry of the two-electron integrals [$(\mu\nu|\lambda\sigma)=(\nu\mu|\lambda\sigma)=(\nu\mu|\sigma\lambda)$, etc.] to show that for a basis set of size $K=100$ there are $12,753,775=O(K^4/8)$ unique two-electron integrals.
I have seen answers to this on the Physics SE here and here, but the case-by-case analysis used in the answers seems confusing to me and not easily generalized to other values of $K$. The symmetry of the integrals when all the basis functions are real suggests that there should be a simpler way of determining this. How can one find the number of unique two-electron integrals in this case and, ideally, in general?