I calculated the number of possibilities
P(n, u, m, c)
to get a total of u with a total modifier m for n stats where every stat has to be <= c.
Then the answer is
(Z18-Z13)/(N18-N13)
where
Nx = sum P(6, u, m, x) over all possible u, m>=1,
and
Zx = sum P(6, u, m, x) * u over all possible...