This currently reports correct numbers for the non-diagonal case, but
incorrect ones for the diagonal case.
The true number lies somewhere between 17880 (probably far too low)
and 23062, but all tests I can come up with intersect correctly so I
don't understand how the second number is wrong.