function n = getnum(v)
%
% For j = 1:N, compute int_{V_j} x p(x) dx
%
% where V_j is an interval.  Here v has length N-1 and
% V_1     = (-inf,v1]
% V_2     = (v1,v2]
% ...
% V_{N-1} = (vN-2,vN-1]
% V_N     = (vN-1,inf)
%
N1 = length(v);
N = N1 + 1;
Ga = 0;
nn = zeros(1,N);
for i = 1:N1
  Gb = G(v(i));
  nn(i) = Gb-Ga;
  Ga = Gb;
end
nn(N) = G(inf) - Ga;
n = nn;
