Alright, that makes sense to me. If instead of doing i<j we just take i=/=j, (forgoing the 2 in front of the summation), I believe there are k^2-k possibilities for i even j odd, k^2-k possibilities for i odd j even, and 2k^2 possibilities for j and i both odd/even. This leaves 4k^2-2k...