text: const advancedDetermine = require("@hugoalh/advanced-determine");
  const mathematicsPermutation = require("./permutation.js");
  /**
   * @function mathematics.cumulativePermutation
   * @alias math.cumulativePermutation
   * @alias math.cumulativePermute
   * @alias mathematics.cumulativePermute
   * @description Calculate the number of cumulative permutation groups.
   * @param {(bigint|number)} n Total number of elements.
   * @returns {(bigint|number)} Number of groups.
   */
  function mathematicsCumulativePermutation(n) {
  	let resultIsBigInteger = false;
  	if (advancedDetermine.isBigInteger(n, { positive: true })) {
  		resultIsBigInteger = true;
  	} else if (advancedDetermine.isNumber(n, { finite: true, integer: true, positive: true, safe: true })) {
  		n = BigInt(n);
  	} else {
  		throw new TypeError(`Argument \`n\` must be type of big integer number (positive) or number (finite, integer, positive, and safe)!`);
  	};
  	let total = 0n;
  	for (let index = 1n; index <= n; index++) {
  		total += mathematicsPermutation(n, index);
  	};
  	return (resultIsBigInteger ? total : Number(total));
  };
  module.exports = mathematicsCumulativePermutation;
  