function factory( n ) {
	var pui;
	if ( isnan( n ) || !isPositiveInteger( n ) || !isfinite( n ) ) {
		return constantFunction( NaN );
	}
	pui = exp( -n * LN2 );
	return quantile;

	/**
	* Evaluates the quantile function of the Wilcoxon signed rank test statistic.
	*
	* @private
	* @param {Probability} p - input value
	* @returns {NonNegativeInteger} evaluated quantile function
	*
	* @example
	* var y = quantile( 0.3 );
	* // returns <number>
	*/
	function quantile( p ) {
		var r;
		var q;
		if ( isnan( p ) || p < 0.0 || p > 1.0 ) {
			return NaN;
		}
		if ( p === 0.0 ) {
			return 0.0;
		}
		if ( p === 1.0 ) {
			return ( n * ( n + 1 ) ) / 2;
		}
		r = 0;
		q = -1;
		while ( r < p ) {
			q += 1;
			r += pui * weights( q, n );
		}
		return q;
	}
}
Returns a function for evaluating the quantile function of the Wilcoxon signed rank test statistic with `n` observations.

@param {PositiveInteger} n - number of observations
@returns {Function} quantile function

@example
var quantile = factory( 10 );
var y = quantile( 0.5 );
// returns 27

y = quantile( 0.8 );
// returns 36