function weights( x, n ) {
	var mlim;

	if ( n === 0 ) {
		return ( x === 0 ) ? 1 : 0;
	}
	mlim = n * ( n + 1 ) / 2;
	if ( x < 0 || x > mlim ) {
		return 0;
	}
	if ( x > mlim / 2 ) {
		x = mlim - x;
	}
	return memoized( x - n, n - 1 ) + memoized( x, n - 1 );
}
Calculates the weight for the `(x,n)` pair and memoizes the result.

@private
@param {number} x - input value
@param {NonNegativeInteger} n - number of observations
@returns {number} weight