@mojir/lits 2.2.3 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -8
- package/dist/cli/cli.js +1264 -909
- package/dist/cli/src/Lits/Lits.d.ts +8 -2
- package/dist/cli/src/builtin/bindingNode.d.ts +2 -1
- package/dist/cli/src/builtin/interface.d.ts +3 -2
- package/dist/cli/src/builtin/modules/number-theory/sequences/index.d.ts +2 -1
- package/dist/cli/src/evaluator/functionExecutors.d.ts +2 -1
- package/dist/cli/src/evaluator/index.d.ts +3 -2
- package/dist/cli/src/evaluator/interface.d.ts +3 -2
- package/dist/cli/src/utils/maybePromise.d.ts +54 -0
- package/dist/full.esm.js +1 -1
- package/dist/full.esm.js.map +1 -1
- package/dist/full.js +1 -1
- package/dist/full.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lits.iife.js +1 -1
- package/dist/lits.iife.js.map +1 -1
- package/dist/modules/assert.esm.js +1 -1
- package/dist/modules/assert.esm.js.map +1 -1
- package/dist/modules/assert.js +1 -1
- package/dist/modules/assert.js.map +1 -1
- package/dist/modules/collection.esm.js +1 -1
- package/dist/modules/collection.esm.js.map +1 -1
- package/dist/modules/collection.js +1 -1
- package/dist/modules/collection.js.map +1 -1
- package/dist/modules/grid.esm.js +1 -1
- package/dist/modules/grid.esm.js.map +1 -1
- package/dist/modules/grid.js +1 -1
- package/dist/modules/grid.js.map +1 -1
- package/dist/modules/number-theory.esm.js +1 -1
- package/dist/modules/number-theory.esm.js.map +1 -1
- package/dist/modules/number-theory.js +1 -1
- package/dist/modules/number-theory.js.map +1 -1
- package/dist/modules/sequence.esm.js +1 -1
- package/dist/modules/sequence.esm.js.map +1 -1
- package/dist/modules/sequence.js +1 -1
- package/dist/modules/sequence.js.map +1 -1
- package/dist/modules/src/Lits/Lits.d.ts +8 -2
- package/dist/modules/src/builtin/bindingNode.d.ts +2 -1
- package/dist/modules/src/builtin/interface.d.ts +3 -2
- package/dist/modules/src/builtin/modules/number-theory/sequences/index.d.ts +2 -1
- package/dist/modules/src/evaluator/functionExecutors.d.ts +2 -1
- package/dist/modules/src/evaluator/index.d.ts +3 -2
- package/dist/modules/src/evaluator/interface.d.ts +3 -2
- package/dist/modules/src/utils/maybePromise.d.ts +54 -0
- package/dist/modules/vector.esm.js +1 -1
- package/dist/modules/vector.esm.js.map +1 -1
- package/dist/modules/vector.js +1 -1
- package/dist/modules/vector.js.map +1 -1
- package/dist/src/Lits/Lits.d.ts +8 -2
- package/dist/src/builtin/bindingNode.d.ts +2 -1
- package/dist/src/builtin/interface.d.ts +3 -2
- package/dist/src/builtin/modules/number-theory/sequences/index.d.ts +2 -1
- package/dist/src/evaluator/functionExecutors.d.ts +2 -1
- package/dist/src/evaluator/index.d.ts +3 -2
- package/dist/src/evaluator/interface.d.ts +3 -2
- package/dist/src/utils/maybePromise.d.ts +54 -0
- package/dist/testFramework.esm.js +1 -1
- package/dist/testFramework.esm.js.map +1 -1
- package/dist/testFramework.js +1 -1
- package/dist/testFramework.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){if(!e.position||!e.code)return"";const t=e.position.column-1,r=e.code.length-t-1;return`${" ".repeat(Math.max(t,0))}^${" ".repeat(Math.max(r,0))}`}class t extends Error{sourceCodeInfo;shortMessage;constructor(r,n){const o=r instanceof Error?r.message:`${r}`;super(function(t,r){if(!r)return t;const n=`${r.position.line}:${r.position.column}`;return`${t}${r.filePath?`\n${r.filePath}:${n}`:`\nLocation ${n}`}\n${r.code}\n${e(r)}`}(o,n)),this.shortMessage=o,this.sourceCodeInfo=n,Object.setPrototypeOf(this,t.prototype),this.name="LitsError"}getCodeMarker(){return this.sourceCodeInfo&&e(this.sourceCodeInfo)}}const r={Number:1,String:2,NormalExpression:3,SpecialExpression:4,UserDefinedSymbol:5,NormalBuiltinSymbol:6,SpecialBuiltinSymbol:7,ReservedSymbol:8,Binding:9,Spread:10},n=new Set(Object.values(r));const o=new Set(["UserDefined","Partial","Comp","Constantly","Juxt","Complement","EveryPred","SomePred","Fnull","Builtin","SpecialBuiltin","NativeJsFunction","Module"]);const i="^^fn^^",a="^^re^^";function s(e){return null!==e&&"object"==typeof e&&(i in e&&"functionType"in e&&("string"==typeof(t=e.functionType)&&o.has(t)));var t}function m(e){return!(!Array.isArray(e)||e.length<2)&&("number"==typeof(t=e[0])&&n.has(t));var t}function u(e){return s(e)?`<function ${e.name||"λ"}>`:m(e)?`${t=e[0],Object.keys(r).find(e=>r[e]===t)}-node`:null===e?"null":"object"==typeof e&&e instanceof RegExp?`${e}`:"object"==typeof e&&e instanceof Error?e.toString():JSON.stringify(e);var t}function h(e,t){return e?.sourceCodeInfo??t}function c(e,t={}){return"number"==typeof e&&(!Number.isNaN(e)&&(!(t.integer&&!Number.isInteger(e))&&(!(t.finite&&!Number.isFinite(e))&&((!t.zero||0===e)&&((!t.nonZero||0!==e)&&(!(t.positive&&e<=0)&&(!(t.negative&&e>=0)&&(!(t.nonPositive&&e>0)&&(!(t.nonNegative&&e<0)&&(!("number"==typeof t.gt&&e<=t.gt)&&(!("number"==typeof t.gte&&e<t.gte)&&(!("number"==typeof t.lt&&e>=t.lt)&&!("number"==typeof t.lte&&e>t.lte)))))))))))))}function l(e,r,n={}){if(!c(e,n))throw new t(`Expected ${function(e){if(e.zero)return"zero";const t=function(e){return e.positive?"positive":e.negative?"negative":e.nonNegative?"non negative":e.nonPositive?"non positive":e.nonZero?"non zero":""}(e),r=e.integer?"integer":"number",n=e.finite?"finite":"",o=function(e){return"number"!=typeof e.gt&&"number"!=typeof e.gte||"number"!=typeof e.lt&&"number"!=typeof e.lte?"number"==typeof e.gt||"number"==typeof e.gte?"number"==typeof e.gt?`n > ${e.gt}`:`n >= ${e.gte}`:"number"==typeof e.lt||"number"==typeof e.lte?"number"==typeof e.lt?`n < ${e.lt}`:`n <= ${e.lte}`:"":`${"number"==typeof e.gt?`${e.gt} < n `:`${e.gte} <= n `}${"number"==typeof e.lt?`< ${e.lt}`:`<= ${e.lte}`}`}(e);return[t,n,r,o].filter(e=>!!e).join(" ")}(n)}, got ${u(e)}.`,h(e,r))}const p=new WeakSet,y=new WeakSet,b=new WeakSet;function g(e,r){if(!function(e){return!(!Array.isArray(e)||!y.has(e)&&(b.has(e)||(e.every(e=>c(e))?(p.add(e),y.add(e),0):(b.add(e),1))))}(e))throw new t(`Expected a vector, but got ${e}`,r)}function f(e,r,n){return new t(`Expected ${e}, got ${u(r)}.`,h(r,n))}function d(e,t){if(!Array.isArray(e))throw f("array",e,t)}function q(e){return null!==e&&"object"==typeof e&&!!e[i]}function v(e){return!(null===e||"object"!=typeof e||Array.isArray(e)||e instanceof RegExp||q(e)||(t=e,null!==t&&"object"==typeof t&&t[a]));var t}function k(e){return function(e){return Array.isArray(e)||"string"==typeof e}(e)||v(e)}function w(e,t){if(!function(e){return"number"==typeof e||!!k(e)||!!q(e)}(e))throw f("FunctionLike",e,t)}function x(e){return{min:e,max:e}}const A={"abundant-seq":{category:"number-theory",description:"Generates the abundant numbers up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { abundant-seq } = import("number-theory");\nabundant-seq(1)','let { abundant-seq } = import("number-theory");\nabundant-seq(5)'],seeAlso:["number-theory.abundant-nth","number-theory.abundant-take-while","number-theory.abundant?","number-theory.deficient-seq","number-theory.perfect-seq"]},"abundant-take-while":{category:"number-theory",description:"Generates the abundant numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { abundant-take-while } = import("number-theory");\nabundant-take-while(-> $ < 100)'],seeAlso:["number-theory.abundant-seq","number-theory.abundant-nth","number-theory.abundant?"]},"abundant-nth":{category:"number-theory",description:"Generates the nth term of the abundant numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the number in the sequence."}},variants:[{argumentNames:["n"]}],examples:['let { abundant-nth } = import("number-theory");\nabundant-nth(1)','let { abundant-nth } = import("number-theory");\nabundant-nth(5)'],seeAlso:["number-theory.abundant-seq","number-theory.abundant-take-while","number-theory.abundant?"]},"abundant?":{category:"number-theory",description:"Checks if a number is abundant.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { abundant? } = import("number-theory");\nabundant?(12)','let { abundant? } = import("number-theory");\nabundant?(15)'],seeAlso:["number-theory.abundant-seq","number-theory.abundant-nth","number-theory.deficient?","number-theory.perfect?","number-theory.sigma","number-theory.divisors","number-theory.abundant-take-while"]},"arithmetic-seq":{category:"number-theory",description:"Generates the arithmetic sequence for a given $start, $step, and $length.",returns:{type:"integer",array:!0},args:{start:{type:"number",description:"The starting term of the sequence."},step:{type:"number",description:"The common difference of the sequence."},length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["start","step","length"]}],examples:['let { arithmetic-seq } = import("number-theory");\narithmetic-seq(3, 2, 2)','let { arithmetic-seq } = import("number-theory");\narithmetic-seq(2, 3, 2)','let { arithmetic-seq } = import("number-theory");\narithmetic-seq(1, 2, 2)','let { arithmetic-seq } = import("number-theory");\narithmetic-seq(1, 1.5, 12)'],seeAlso:["number-theory.arithmetic-nth","number-theory.arithmetic-take-while","number-theory.arithmetic?","number-theory.geometric-seq"]},"arithmetic-take-while":{category:"number-theory",description:"Generates the arithmetic sequence while a condition is met.",returns:{type:"integer",array:!0},args:{start:{type:"number",description:"The starting term of the sequence."},step:{type:"number",description:"The common difference of the sequence."},takeWhile:{type:"function",description:"A function that takes a number and an index and returns a boolean."}},variants:[{argumentNames:["start","step","takeWhile"]}],examples:['let { arithmetic-take-while } = import("number-theory");\narithmetic-take-while(1, 0.25, -> $ < 3)'],seeAlso:["number-theory.arithmetic-seq","number-theory.arithmetic-nth","number-theory.arithmetic?"]},"arithmetic-nth":{category:"number-theory",description:"Generates the nth term of the arithmetic sequence.",returns:{type:"integer"},args:{start:{type:"number",description:"The starting term of the sequence."},step:{type:"number",description:"The common difference of the sequence."},n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["start","step","n"]}],examples:['let { arithmetic-nth } = import("number-theory");\narithmetic-nth(3, 2, 2)','let { arithmetic-nth } = import("number-theory");\narithmetic-nth(2, 3, 2)','let { arithmetic-nth } = import("number-theory");\narithmetic-nth(1, 2, 2)','let { arithmetic-nth } = import("number-theory");\narithmetic-nth(1, 1.5, 12)'],seeAlso:["number-theory.arithmetic-seq","number-theory.arithmetic-take-while","number-theory.arithmetic?"]},"arithmetic?":{category:"number-theory",description:"Checks if a number is part of the arithmetic sequence.",returns:{type:"boolean"},args:{start:{type:"number",description:"The starting term of the sequence."},step:{type:"number",description:"The common difference of the sequence."},n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["start","step","n"]}],examples:['let { arithmetic? } = import("number-theory");\narithmetic?(3, 2, 2)','let { arithmetic? } = import("number-theory");\narithmetic?(2, 3, 2)','let { arithmetic? } = import("number-theory");\narithmetic?(1, 2, 2)','let { arithmetic? } = import("number-theory");\narithmetic?(1, 1.5, 12)'],seeAlso:["number-theory.arithmetic-seq","number-theory.arithmetic-nth","number-theory.geometric?","number-theory.arithmetic-take-while"]},"bell-seq":{category:"number-theory",description:"Generates the Bell sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 22 (the maximum length of the pre-calculated bell numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { bell-seq } = import("number-theory");\nbell-seq(5)','let { bell-seq } = import("number-theory");\nbell-seq(10)','let { bell-seq } = import("number-theory");\nbell-seq()'],seeAlso:["number-theory.bell-nth","number-theory.bell-take-while","number-theory.bell?","number-theory.catalan-seq","number-theory.stirling-second","number-theory.stirling-first"]},"bell-take-while":{category:"number-theory",description:"Generates the Bell sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { bell-take-while } = import("number-theory");\nbell-take-while(-> $ < 1000)'],seeAlso:["number-theory.bell-seq","number-theory.bell-nth","number-theory.bell?"]},"bell-nth":{category:"number-theory",description:"Generates the nth term of the Bell sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { bell-nth } = import("number-theory");\nbell-nth(5)','let { bell-nth } = import("number-theory");\nbell-nth(10)'],seeAlso:["number-theory.bell-seq","number-theory.bell-take-while","number-theory.bell?"]},"bell?":{category:"number-theory",description:"Checks if a number is in the Bell sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { bell? } = import("number-theory");\nbell?(1)','let { bell? } = import("number-theory");\nbell?(27644437)','let { bell? } = import("number-theory");\nbell?(27644436)'],seeAlso:["number-theory.bell-seq","number-theory.bell-nth","number-theory.catalan?","number-theory.bell-take-while"]},"bernoulli-seq":{category:"number-theory",description:"Generates the Bernoulli sequence up to a specified length.",returns:{type:"number",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { bernoulli-seq } = import("number-theory");\nbernoulli-seq(5)','let { bernoulli-seq } = import("number-theory");\nbernoulli-seq(10)'],seeAlso:["number-theory.bernoulli-nth","number-theory.bernoulli-take-while"]},"bernoulli-take-while":{category:"number-theory",description:"Generates the Bernoulli sequence while a condition is met.",returns:{type:"number",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { bernoulli-take-while } = import("number-theory");\nbernoulli-take-while(-> abs($) < 100)'],seeAlso:["number-theory.bernoulli-seq","number-theory.bernoulli-nth"]},"bernoulli-nth":{category:"number-theory",description:"Generates the nth term of the Bernoulli sequence.",returns:{type:"number"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { bernoulli-nth } = import("number-theory");\nbernoulli-nth(5)','let { bernoulli-nth } = import("number-theory");\nbernoulli-nth(10)','let { bernoulli-nth } = import("number-theory");\nbernoulli-nth(23)'],seeAlso:["number-theory.bernoulli-seq","number-theory.bernoulli-take-while"]},"catalan-seq":{category:"number-theory",description:"Generates the Catalan sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 30 (the maximum length of the pre-calculated catalan numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { catalan-seq } = import("number-theory");\ncatalan-seq(5)','let { catalan-seq } = import("number-theory");\ncatalan-seq(10)','let { catalan-seq } = import("number-theory");\ncatalan-seq()'],seeAlso:["number-theory.catalan-nth","number-theory.catalan-take-while","number-theory.catalan?","number-theory.bell-seq"]},"catalan-take-while":{category:"number-theory",description:"Generates the Catalan sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { catalan-take-while } = import("number-theory");\ncatalan-take-while(-> $ < 1000)'],seeAlso:["number-theory.catalan-seq","number-theory.catalan-nth","number-theory.catalan?"]},"catalan-nth":{category:"number-theory",description:"Generates the nth term of the Catalan sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { catalan-nth } = import("number-theory");\ncatalan-nth(5)','let { catalan-nth } = import("number-theory");\ncatalan-nth(10)'],seeAlso:["number-theory.catalan-seq","number-theory.catalan-take-while","number-theory.catalan?"]},"catalan?":{category:"number-theory",description:"Determines if a number is in the Catalan sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { catalan? } = import("number-theory");\ncatalan?(5)','let { catalan? } = import("number-theory");\ncatalan?(10)'],seeAlso:["number-theory.catalan-seq","number-theory.catalan-nth","number-theory.bell?","number-theory.catalan-take-while"]},"collatz-seq":{category:"number-theory",description:"Generates the collatz sequence starting from a given integer.",returns:{type:"integer",array:!0},args:{start:{type:"integer",description:"The starting integer for the collatz sequence."}},variants:[{argumentNames:["start"]}],examples:['let { collatz-seq } = import("number-theory");\ncollatz-seq(3)','let { collatz-seq } = import("number-theory");\ncollatz-seq(11)'],seeAlso:["number-theory.juggler-seq"]},"composite-seq":{category:"number-theory",description:"Generates the composite sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { composite-seq } = import("number-theory");\ncomposite-seq(1)','let { composite-seq } = import("number-theory");\ncomposite-seq(2)','let { composite-seq } = import("number-theory");\ncomposite-seq(10)'],seeAlso:["number-theory.composite-nth","number-theory.composite-take-while","number-theory.composite?","number-theory.prime-seq"]},"composite-take-while":{category:"number-theory",description:"Generates the composite sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { composite-take-while } = import("number-theory");\ncomposite-take-while(-> $ < 50)'],seeAlso:["number-theory.composite-seq","number-theory.composite-nth","number-theory.composite?"]},"composite-nth":{category:"number-theory",description:"Generates the nth term of the composite sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the composite number to retrieve."}},variants:[{argumentNames:["n"]}],examples:['let { composite-nth } = import("number-theory");\ncomposite-nth(1)','let { composite-nth } = import("number-theory");\ncomposite-nth(2)','let { composite-nth } = import("number-theory");\ncomposite-nth(10)'],seeAlso:["number-theory.composite-seq","number-theory.composite-take-while","number-theory.composite?"]},"composite?":{category:"number-theory",description:"Determines if a number is composite.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { composite? } = import("number-theory");\ncomposite?(4)','let { composite? } = import("number-theory");\ncomposite?(5)','let { composite? } = import("number-theory");\ncomposite?(11)'],seeAlso:["number-theory.composite-seq","number-theory.composite-nth","number-theory.prime?","number-theory.prime-factors","number-theory.composite-take-while"]},"deficient-seq":{category:"number-theory",description:"Generates the deficient numbers up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { deficient-seq } = import("number-theory");\ndeficient-seq(1)','let { deficient-seq } = import("number-theory");\ndeficient-seq(5)'],seeAlso:["number-theory.deficient-nth","number-theory.deficient-take-while","number-theory.deficient?","number-theory.abundant-seq","number-theory.perfect-seq"]},"deficient-take-while":{category:"number-theory",description:"Generates the deficient numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { deficient-take-while } = import("number-theory");\ndeficient-take-while(-> $ < 100)'],seeAlso:["number-theory.deficient-seq","number-theory.deficient-nth","number-theory.deficient?"]},"deficient-nth":{category:"number-theory",description:"Generates the nth term of the deficient numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the number in the sequence."}},variants:[{argumentNames:["n"]}],examples:['let { deficient-nth } = import("number-theory");\ndeficient-nth(5)','let { deficient-nth } = import("number-theory");\ndeficient-nth(12)'],seeAlso:["number-theory.deficient-seq","number-theory.deficient-take-while","number-theory.deficient?"]},"deficient?":{category:"number-theory",description:"Checks if a number is deficient.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { deficient? } = import("number-theory");\ndeficient?(12)','let { deficient? } = import("number-theory");\ndeficient?(15)'],seeAlso:["number-theory.deficient-seq","number-theory.deficient-nth","number-theory.abundant?","number-theory.perfect?","number-theory.sigma","number-theory.divisors","number-theory.deficient-take-while"]},"factorial-seq":{category:"number-theory",description:"Generates the factorial sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 19 (the maximum length of the pre-calculated factorial numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { factorial-seq } = import("number-theory");\nfactorial-seq(1)','let { factorial-seq } = import("number-theory");\nfactorial-seq(2)','let { factorial-seq } = import("number-theory");\nfactorial-seq(3)','let { factorial-seq } = import("number-theory");\nfactorial-seq(4)','let { factorial-seq } = import("number-theory");\nfactorial-seq(5)','let { factorial-seq } = import("number-theory");\nfactorial-seq(10)'],seeAlso:["number-theory.factorial-nth","number-theory.factorial-take-while","number-theory.factorial?","number-theory.factorial"]},"factorial-take-while":{category:"number-theory",description:"Generates the factorial sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { factorial-take-while } = import("number-theory");\nfactorial-take-while(-> $ < 1000)'],seeAlso:["number-theory.factorial-seq","number-theory.factorial-nth","number-theory.factorial?"]},"factorial-nth":{category:"number-theory",description:"Generates the nth term of the factorial sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { factorial-nth } = import("number-theory");\nfactorial-nth(1)','let { factorial-nth } = import("number-theory");\nfactorial-nth(2)','let { factorial-nth } = import("number-theory");\nfactorial-nth(3)','let { factorial-nth } = import("number-theory");\nfactorial-nth(4)','let { factorial-nth } = import("number-theory");\nfactorial-nth(5)','let { factorial-nth } = import("number-theory");\nfactorial-nth(10)'],seeAlso:["number-theory.factorial-seq","number-theory.factorial-take-while","number-theory.factorial?","number-theory.factorial"]},"factorial?":{category:"number-theory",description:"Checks if a number is in the factorial sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { factorial? } = import("number-theory");\nfactorial?(1)','let { factorial? } = import("number-theory");\nfactorial?(2)','let { factorial? } = import("number-theory");\nfactorial?(3)','let { factorial? } = import("number-theory");\nfactorial?(4)','let { factorial? } = import("number-theory");\nfactorial?(5)','let { factorial? } = import("number-theory");\nfactorial?(6)','let { factorial? } = import("number-theory");\nfactorial?(7)','let { factorial? } = import("number-theory");\nfactorial?(8)','let { factorial? } = import("number-theory");\nfactorial?(9)','let { factorial? } = import("number-theory");\nfactorial?(3628800)'],seeAlso:["number-theory.factorial-seq","number-theory.factorial-nth","number-theory.factorial","number-theory.factorial-take-while"]},"fibonacci-seq":{category:"number-theory",description:"Generates the fibonacci sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 79 (the maximum length of the pre-calculated Fibonacci numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { fibonacci-seq } = import("number-theory");\nfibonacci-seq(1)','let { fibonacci-seq } = import("number-theory");\nfibonacci-seq(2)','let { fibonacci-seq } = import("number-theory");\nfibonacci-seq()'],seeAlso:["number-theory.fibonacci-nth","number-theory.fibonacci-take-while","number-theory.fibonacci?","number-theory.lucas-seq","number-theory.tribonacci-seq","number-theory.pell-seq","number-theory.padovan-seq"]},"fibonacci-take-while":{category:"number-theory",description:"Generates the fibonacci sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { fibonacci-take-while } = import("number-theory");\nfibonacci-take-while(-> $ < 100)'],seeAlso:["number-theory.fibonacci-seq","number-theory.fibonacci-nth","number-theory.fibonacci?"]},"fibonacci-nth":{category:"number-theory",description:"Generates the nth term of the fibonacci sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { fibonacci-nth } = import("number-theory");\nfibonacci-nth(5)','let { fibonacci-nth } = import("number-theory");\nfibonacci-nth(50)'],seeAlso:["number-theory.fibonacci-seq","number-theory.fibonacci-take-while","number-theory.fibonacci?"]},"fibonacci?":{category:"number-theory",description:"Determines if a number is in the fibonacci sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { fibonacci? } = import("number-theory");\nfibonacci?(0)','let { fibonacci? } = import("number-theory");\nfibonacci?(1)','let { fibonacci? } = import("number-theory");\nfibonacci?(2)','let { fibonacci? } = import("number-theory");\nfibonacci?(3)','let { fibonacci? } = import("number-theory");\nfibonacci?(4)','let { fibonacci? } = import("number-theory");\nfibonacci?(5)','let { fibonacci? } = import("number-theory");\nfibonacci?(6)','let { fibonacci? } = import("number-theory");\nfibonacci?(7)','let { fibonacci? } = import("number-theory");\nfibonacci?(8)','let { fibonacci? } = import("number-theory");\nfibonacci?(9)'],seeAlso:["number-theory.fibonacci-seq","number-theory.fibonacci-nth","number-theory.lucas?","number-theory.fibonacci-take-while","number-theory.tribonacci?","number-theory.padovan?","number-theory.pell?"]},"geometric-seq":{category:"number-theory",description:"Generates the geometric sequence for a given $start, $ratio, and $length.",returns:{type:"integer",array:!0},args:{start:{type:"number",description:"The starting term of the sequence."},ratio:{type:"number",description:"The common ratio of the sequence."},length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["start","ratio","length"]}],examples:['let { geometric-seq } = import("number-theory");\ngeometric-seq(3, 2, 2)','let { geometric-seq } = import("number-theory");\ngeometric-seq(2, 3, 2)','let { geometric-seq } = import("number-theory");\ngeometric-seq(1, 2, 2)','let { geometric-seq } = import("number-theory");\ngeometric-seq(1, 1.5, 12)'],seeAlso:["number-theory.geometric-nth","number-theory.geometric-take-while","number-theory.geometric?","number-theory.arithmetic-seq"]},"geometric-take-while":{category:"number-theory",description:"Generates the geometric sequence while a condition is met.",returns:{type:"integer",array:!0},args:{start:{type:"number",description:"The starting term of the sequence."},ratio:{type:"number",description:"The common ratio of the sequence."},takeWhile:{type:"function",description:"A function that takes a number and an index and returns a boolean."}},variants:[{argumentNames:["start","ratio","takeWhile"]}],examples:['let { geometric-take-while } = import("number-theory");\ngeometric-take-while(1, 1.5, -> $ < 10)'],seeAlso:["number-theory.geometric-seq","number-theory.geometric-nth","number-theory.geometric?"]},"geometric-nth":{category:"number-theory",description:"Generates the nth term of the geometric sequence.",returns:{type:"integer"},args:{start:{type:"number",description:"The starting term of the sequence."},ratio:{type:"number",description:"The common ratio of the sequence."},n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["start","ratio","n"]}],examples:['let { geometric-nth } = import("number-theory");\ngeometric-nth(3, 2, 2)','let { geometric-nth } = import("number-theory");\ngeometric-nth(2, 3, 2)','let { geometric-nth } = import("number-theory");\ngeometric-nth(1, 2, 2)','let { geometric-nth } = import("number-theory");\ngeometric-nth(1, 1.5, 4)'],seeAlso:["number-theory.geometric-seq","number-theory.geometric-take-while","number-theory.geometric?"]},"geometric?":{category:"number-theory",description:"Checks if a number is in the geometric sequence.",returns:{type:"boolean"},args:{start:{type:"number",description:"The starting term of the sequence."},ratio:{type:"number",description:"The common ratio of the sequence."},n:{type:"number",description:"The number to check."}},variants:[{argumentNames:["start","ratio","n"]}],examples:['let { geometric? } = import("number-theory");\ngeometric?(1, 2, 1)','let { geometric? } = import("number-theory");\ngeometric?(2, 3, 2)','let { geometric? } = import("number-theory");\ngeometric?(3, 2, 2)','let { geometric? } = import("number-theory");\ngeometric?(1, 1.5, 2.25)','let { geometric? } = import("number-theory");\ngeometric?(1, 1.5, -4)'],seeAlso:["number-theory.geometric-seq","number-theory.geometric-nth","number-theory.arithmetic?","number-theory.geometric-take-while"]},"golomb-seq":{category:"number-theory",description:"Generates the Golomb sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { golomb-seq } = import("number-theory");\ngolomb-seq(5)','let { golomb-seq } = import("number-theory");\ngolomb-seq(20)'],seeAlso:["number-theory.golomb-nth","number-theory.golomb-take-while","number-theory.golomb?","number-theory.recaman-seq"]},"golomb-take-while":{category:"number-theory",description:"Generates the Golomb sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { golomb-take-while } = import("number-theory");\ngolomb-take-while(-> $ <= 10)'],seeAlso:["number-theory.golomb-seq","number-theory.golomb-nth","number-theory.golomb?"]},"golomb-nth":{category:"number-theory",description:"Generates the nth term of the Golomb sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { golomb-nth } = import("number-theory");\ngolomb-nth(5)','let { golomb-nth } = import("number-theory");\ngolomb-nth(1000)'],seeAlso:["number-theory.golomb-seq","number-theory.golomb-take-while","number-theory.golomb?"]},"golomb?":{category:"number-theory",description:"Checks if a number is in the Golomb sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { golomb? } = import("number-theory");\ngolomb?(1)','let { golomb? } = import("number-theory");\ngolomb?(2)','let { golomb? } = import("number-theory");\ngolomb?(3345)','let { golomb? } = import("number-theory");\ngolomb?(67867864)'],seeAlso:["number-theory.golomb-seq","number-theory.golomb-nth","number-theory.golomb-take-while"]},"happy-seq":{category:"number-theory",description:"Generates the happy sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 20 (the maximum length of the pre-calculated happy numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { happy-seq } = import("number-theory");\nhappy-seq(1)','let { happy-seq } = import("number-theory");\nhappy-seq(2)','let { happy-seq } = import("number-theory");\nhappy-seq(20)'],seeAlso:["number-theory.happy-nth","number-theory.happy-take-while","number-theory.happy?","number-theory.lucky-seq"]},"happy-take-while":{category:"number-theory",description:"Generates the happy sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { happy-take-while } = import("number-theory");\nhappy-take-while(-> $ < 100)'],seeAlso:["number-theory.happy-seq","number-theory.happy-nth","number-theory.happy?"]},"happy-nth":{category:"number-theory",description:"Generates the nth term of the happy sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the happy number to return."}},variants:[{argumentNames:["n"]}],examples:['let { happy-nth } = import("number-theory");\nhappy-nth(1)','let { happy-nth } = import("number-theory");\nhappy-nth(2)','let { happy-nth } = import("number-theory");\nhappy-nth(20)'],seeAlso:["number-theory.happy-seq","number-theory.happy-take-while","number-theory.happy?"]},"happy?":{category:"number-theory",description:"Determines if a number is a happy number.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { happy? } = import("number-theory");\nhappy?(1)','let { happy? } = import("number-theory");\nhappy?(2)','let { happy? } = import("number-theory");\nhappy?(100)'],seeAlso:["number-theory.happy-seq","number-theory.happy-nth","number-theory.happy-take-while"]},"juggler-seq":{category:"number-theory",description:"Generates the Juggler sequence starting from a given integer.",returns:{type:"integer",array:!0},args:{start:{type:"integer",description:"The starting integer for the Juggler sequence."}},variants:[{argumentNames:["start"]}],examples:['let { juggler-seq } = import("number-theory");\njuggler-seq(3)','let { juggler-seq } = import("number-theory");\njuggler-seq(5)'],seeAlso:["number-theory.collatz-seq"]},"look-and-say-seq":{category:"number-theory",description:"Generates the Look-and-Say sequence up to a specified length.",returns:{type:"string",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { look-and-say-seq } = import("number-theory");\nlook-and-say-seq(5)'],seeAlso:["number-theory.look-and-say-nth","number-theory.look-and-say-take-while","number-theory.look-and-say?"]},"look-and-say-take-while":{category:"number-theory",description:"Generates the Look-and-Say sequence while a condition is met.",returns:{type:"string",array:!0},args:{takeWhile:{type:"function",description:"A function that takes a string and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { look-and-say-take-while } = import("number-theory");\nlook-and-say-take-while((term, index) -> count(term) < 10)','let { look-and-say-take-while } = import("number-theory");\nlook-and-say-take-while(-> $2 <= 10)'],seeAlso:["number-theory.look-and-say-seq","number-theory.look-and-say-nth","number-theory.look-and-say?"]},"look-and-say-nth":{category:"number-theory",description:"Generates the nth term of the Look-and-Say sequence.",returns:{type:"string"},args:{n:{type:"integer",description:"The index of the term in the sequence."}},variants:[{argumentNames:["n"]}],examples:['let { look-and-say-nth } = import("number-theory");\nlook-and-say-nth(5)'],seeAlso:["number-theory.look-and-say-seq","number-theory.look-and-say-take-while","number-theory.look-and-say?"]},"look-and-say?":{category:"number-theory",description:"Checks if a string is a valid Look-and-Say term.",returns:{type:"boolean"},args:{term:{type:"string",description:"The term to check."}},variants:[{argumentNames:["term"]}],examples:['let { look-and-say? } = import("number-theory");\nlook-and-say?("111221")','let { look-and-say? } = import("number-theory");\nlook-and-say?("123")'],seeAlso:["number-theory.look-and-say-seq","number-theory.look-and-say-nth","number-theory.look-and-say-take-while"]},"lucas-seq":{category:"number-theory",description:"Generates the lucas sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 77 (the maximum length of the pre-calculated Lucas numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { lucas-seq } = import("number-theory");\nlucas-seq(1)','let { lucas-seq } = import("number-theory");\nlucas-seq(2)','let { lucas-seq } = import("number-theory");\nlucas-seq()'],seeAlso:["number-theory.lucas-nth","number-theory.lucas-take-while","number-theory.lucas?","number-theory.fibonacci-seq"]},"lucas-take-while":{category:"number-theory",description:"Generates the lucas sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { lucas-take-while } = import("number-theory");\nlucas-take-while(-> $ < 100)'],seeAlso:["number-theory.lucas-seq","number-theory.lucas-nth","number-theory.lucas?"]},"lucas-nth":{category:"number-theory",description:"Generates the nth term of the lucas sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { lucas-nth } = import("number-theory");\nlucas-nth(1)','let { lucas-nth } = import("number-theory");\nlucas-nth(2)','let { lucas-nth } = import("number-theory");\nlucas-nth(10)'],seeAlso:["number-theory.lucas-seq","number-theory.lucas-take-while","number-theory.lucas?"]},"lucas?":{category:"number-theory",description:"Determines if a number is in the lucas sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { lucas? } = import("number-theory");\nlucas?(1)','let { lucas? } = import("number-theory");\nlucas?(2)','let { lucas? } = import("number-theory");\nlucas?(10)'],seeAlso:["number-theory.lucas-seq","number-theory.lucas-nth","number-theory.fibonacci?","number-theory.lucas-take-while"]},"lucky-seq":{category:"number-theory",description:"Generates the lucky sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { lucky-seq } = import("number-theory");\nlucky-seq(1)','let { lucky-seq } = import("number-theory");\nlucky-seq(2)','let { lucky-seq } = import("number-theory");\nlucky-seq(20)'],seeAlso:["number-theory.lucky-nth","number-theory.lucky-take-while","number-theory.lucky?","number-theory.happy-seq","number-theory.prime-seq"]},"lucky-take-while":{category:"number-theory",description:"Generates the lucky sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { lucky-take-while } = import("number-theory");\nlucky-take-while(-> $ < 100)'],seeAlso:["number-theory.lucky-seq","number-theory.lucky-nth","number-theory.lucky?"]},"lucky-nth":{category:"number-theory",description:"Generates the nth term of the lucky sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The position in the sequence."}},variants:[{argumentNames:["n"]}],examples:['let { lucky-nth } = import("number-theory");\nlucky-nth(1)','let { lucky-nth } = import("number-theory");\nlucky-nth(2)','let { lucky-nth } = import("number-theory");\nlucky-nth(20)'],seeAlso:["number-theory.lucky-seq","number-theory.lucky-take-while","number-theory.lucky?"]},"lucky?":{category:"number-theory",description:"Checks if a number is a lucky number.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { lucky? } = import("number-theory");\nlucky?(4)','let { lucky? } = import("number-theory");\nlucky?(7)','let { lucky? } = import("number-theory");\nlucky?(33)'],seeAlso:["number-theory.lucky-seq","number-theory.lucky-nth","number-theory.prime?","number-theory.lucky-take-while"]},"mersenne-seq":{category:"number-theory",description:"Generates the Mersenne sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 9 (the maximum length of the pre-calculated mersenne numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { mersenne-seq } = import("number-theory");\nmersenne-seq(1)','let { mersenne-seq } = import("number-theory");\nmersenne-seq(5)','let { mersenne-seq } = import("number-theory");\nmersenne-seq()'],seeAlso:["number-theory.mersenne-nth","number-theory.mersenne-take-while","number-theory.mersenne?","number-theory.prime-seq"]},"mersenne-take-while":{category:"number-theory",description:"Generates the Mersenne sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { mersenne-take-while } = import("number-theory");\nmersenne-take-while(-> $ < 1000)'],seeAlso:["number-theory.mersenne-seq","number-theory.mersenne-nth","number-theory.mersenne?"]},"mersenne-nth":{category:"number-theory",description:"Generates the nth term of the Mersenne sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { mersenne-nth } = import("number-theory");\nmersenne-nth(1)','let { mersenne-nth } = import("number-theory");\nmersenne-nth(5)'],seeAlso:["number-theory.mersenne-seq","number-theory.mersenne-take-while","number-theory.mersenne?"]},"mersenne?":{category:"number-theory",description:"Checks if a number is in the Mersenne sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { mersenne? } = import("number-theory");\nmersenne?(3)','let { mersenne? } = import("number-theory");\nmersenne?(4)','let { mersenne? } = import("number-theory");\nmersenne?(7)'],seeAlso:["number-theory.mersenne-seq","number-theory.mersenne-nth","number-theory.prime?","number-theory.mersenne-take-while"]},"padovan-seq":{category:"number-theory",description:"Generates the Padovan sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { padovan-seq } = import("number-theory");\npadovan-seq(5)','let { padovan-seq } = import("number-theory");\npadovan-seq(10)','let { padovan-seq } = import("number-theory");\npadovan-seq(20)'],seeAlso:["number-theory.padovan-nth","number-theory.padovan-take-while","number-theory.padovan?","number-theory.fibonacci-seq"]},"padovan-take-while":{category:"number-theory",description:"Generates the Padovan sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { padovan-take-while } = import("number-theory");\npadovan-take-while(-> $ < 1000)'],seeAlso:["number-theory.padovan-seq","number-theory.padovan-nth","number-theory.padovan?"]},"padovan-nth":{category:"number-theory",description:"Generates the nth term of the Padovan sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { padovan-nth } = import("number-theory");\npadovan-nth(5)','let { padovan-nth } = import("number-theory");\npadovan-nth(10)','let { padovan-nth } = import("number-theory");\npadovan-nth(20)'],seeAlso:["number-theory.padovan-seq","number-theory.padovan-take-while","number-theory.padovan?"]},"padovan?":{category:"number-theory",description:"Checks if a number is in the Padovan sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { padovan? } = import("number-theory");\npadovan?(1)','let { padovan? } = import("number-theory");\npadovan?(265)','let { padovan? } = import("number-theory");\npadovan?(6)'],seeAlso:["number-theory.padovan-seq","number-theory.padovan-nth","number-theory.fibonacci?","number-theory.padovan-take-while"]},"partition-seq":{category:"number-theory",description:"Generates the partition numbers up to a specified length. If no length is provided, it defaults to 299 (the maximum length of the pre-calculated partition numbers).",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { partition-seq } = import("number-theory");\npartition-seq(1)','let { partition-seq } = import("number-theory");\npartition-seq(10)','let { partition-seq } = import("number-theory");\npartition-seq()'],seeAlso:["number-theory.partition-nth","number-theory.partition-take-while","number-theory.partition?","number-theory.partitions","number-theory.count-partitions"]},"partition-take-while":{category:"number-theory",description:"Generates the partition numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { partition-take-while } = import("number-theory");\npartition-take-while(-> $ < 1000)'],seeAlso:["number-theory.partition-seq","number-theory.partition-nth","number-theory.partition?"]},"partition-nth":{category:"number-theory",description:"Generates the nth term of the partition numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the partition number to generate."}},variants:[{argumentNames:["n"]}],examples:['let { partition-nth } = import("number-theory");\npartition-nth(1)','let { partition-nth } = import("number-theory");\npartition-nth(5)'],seeAlso:["number-theory.partition-seq","number-theory.partition-take-while","number-theory.partition?"]},"partition?":{category:"number-theory",description:"Checks if a number is in the partition numbers.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { partition? } = import("number-theory");\npartition?(0)','let { partition? } = import("number-theory");\npartition?(1)','let { partition? } = import("number-theory");\npartition?(2)','let { partition? } = import("number-theory");\npartition?(3)','let { partition? } = import("number-theory");\npartition?(4)','let { partition? } = import("number-theory");\npartition?(5)'],seeAlso:["number-theory.partition-seq","number-theory.partition-nth","number-theory.partitions","number-theory.partition-take-while"]},"pell-seq":{category:"number-theory",description:"Generates the Pell sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 42 (the maximum length of the pre-calculated Pell numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { pell-seq } = import("number-theory");\npell-seq(5)','let { pell-seq } = import("number-theory");\npell-seq(10)','let { pell-seq } = import("number-theory");\npell-seq()'],seeAlso:["number-theory.pell-nth","number-theory.pell-take-while","number-theory.pell?","number-theory.fibonacci-seq"]},"pell-take-while":{category:"number-theory",description:"Generates the Pell sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { pell-take-while } = import("number-theory");\npell-take-while(-> $ < 1000)'],seeAlso:["number-theory.pell-seq","number-theory.pell-nth","number-theory.pell?"]},"pell-nth":{category:"number-theory",description:"Generates the nth term of the Pell sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { pell-nth } = import("number-theory");\npell-nth(5)','let { pell-nth } = import("number-theory");\npell-nth(10)','let { pell-nth } = import("number-theory");\npell-nth(20)'],seeAlso:["number-theory.pell-seq","number-theory.pell-take-while","number-theory.pell?"]},"pell?":{category:"number-theory",description:"Checks if a number is a Pell number.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { pell? } = import("number-theory");\npell?(1)','let { pell? } = import("number-theory");\npell?(470832)','let { pell? } = import("number-theory");\npell?(10)'],seeAlso:["number-theory.pell-seq","number-theory.pell-nth","number-theory.fibonacci?","number-theory.pell-take-while"]},"perfect-seq":{category:"number-theory",description:"Generates the perfect numbers up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If no length is provided, it defaults to 7 (the maximum length of the pre-calculated perfect numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { perfect-seq } = import("number-theory");\nperfect-seq(1)','let { perfect-seq } = import("number-theory");\nperfect-seq(5)','let { perfect-seq } = import("number-theory");\nperfect-seq()'],seeAlso:["number-theory.perfect-nth","number-theory.perfect-take-while","number-theory.perfect?","number-theory.abundant-seq","number-theory.deficient-seq","number-theory.amicable?"]},"perfect-take-while":{category:"number-theory",description:"Generates the perfect numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { perfect-take-while } = import("number-theory");\nperfect-take-while(-> $ < 1000)'],seeAlso:["number-theory.perfect-seq","number-theory.perfect-nth","number-theory.perfect?"]},"perfect-nth":{category:"number-theory",description:"Generates the nth term of the perfect numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the perfect number to generate."}},variants:[{argumentNames:["n"]}],examples:['let { perfect-nth } = import("number-theory");\nperfect-nth(1)','let { perfect-nth } = import("number-theory");\nperfect-nth(5)'],seeAlso:["number-theory.perfect-seq","number-theory.perfect-take-while","number-theory.perfect?"]},"perfect?":{category:"number-theory",description:"Checks if a number is in the perfect numbers.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { perfect? } = import("number-theory");\nperfect?(0)','let { perfect? } = import("number-theory");\nperfect?(1)','let { perfect? } = import("number-theory");\nperfect?(2)','let { perfect? } = import("number-theory");\nperfect?(3)','let { perfect? } = import("number-theory");\nperfect?(4)','let { perfect? } = import("number-theory");\nperfect?(5)','let { perfect? } = import("number-theory");\nperfect?(6)','let { perfect? } = import("number-theory");\nperfect?(7)','let { perfect? } = import("number-theory");\nperfect?(8)','let { perfect? } = import("number-theory");\nperfect?(9)'],seeAlso:["number-theory.perfect-seq","number-theory.perfect-nth","number-theory.abundant?","number-theory.deficient?","number-theory.sigma","number-theory.perfect-take-while","number-theory.amicable?","number-theory.proper-divisors"]},"perfect-square-seq":{category:"number-theory",description:"Generates the perfect square numbers up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { perfect-square-seq } = import("number-theory");\nperfect-square-seq(5)','let { perfect-square-seq } = import("number-theory");\nperfect-square-seq(20)'],seeAlso:["number-theory.perfect-square-nth","number-theory.perfect-square-take-while","number-theory.perfect-square?","number-theory.perfect-cube-seq","number-theory.perfect-power-seq","number-theory.polygonal-seq"]},"perfect-square-take-while":{category:"number-theory",description:"Generates the perfect square numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { perfect-square-take-while } = import("number-theory");\nperfect-square-take-while(-> $ <= 100)'],seeAlso:["number-theory.perfect-square-seq","number-theory.perfect-square-nth","number-theory.perfect-square?"]},"perfect-square-nth":{category:"number-theory",description:"Generates the nth term of the perfect square numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { perfect-square-nth } = import("number-theory");\nperfect-square-nth(1)','let { perfect-square-nth } = import("number-theory");\nperfect-square-nth(5)'],seeAlso:["number-theory.perfect-square-seq","number-theory.perfect-square-take-while","number-theory.perfect-square?"]},"perfect-square?":{category:"number-theory",description:"Checks if a number is a perfect square.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { perfect-square? } = import("number-theory");\nperfect-square?(16)','let { perfect-square? } = import("number-theory");\nperfect-square?(20)'],seeAlso:["number-theory.perfect-square-seq","number-theory.perfect-square-nth","number-theory.perfect-cube?","number-theory.perfect-power?","number-theory.perfect-square-take-while","number-theory.perfect-power","number-theory.polygonal?"]},"perfect-cube-seq":{category:"number-theory",description:"Generates the perfect cube numbers up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { perfect-cube-seq } = import("number-theory");\nperfect-cube-seq(5)','let { perfect-cube-seq } = import("number-theory");\nperfect-cube-seq(20)'],seeAlso:["number-theory.perfect-cube-nth","number-theory.perfect-cube-take-while","number-theory.perfect-cube?","number-theory.perfect-square-seq","number-theory.perfect-power-seq"]},"perfect-cube-take-while":{category:"number-theory",description:"Generates the perfect cube numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { perfect-cube-take-while } = import("number-theory");\nperfect-cube-take-while(-> $ <= 100)'],seeAlso:["number-theory.perfect-cube-seq","number-theory.perfect-cube-nth","number-theory.perfect-cube?"]},"perfect-cube-nth":{category:"number-theory",description:"Generates the nth term of the perfect cube numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { perfect-cube-nth } = import("number-theory");\nperfect-cube-nth(1)','let { perfect-cube-nth } = import("number-theory");\nperfect-cube-nth(5)'],seeAlso:["number-theory.perfect-cube-seq","number-theory.perfect-cube-take-while","number-theory.perfect-cube?"]},"perfect-cube?":{category:"number-theory",description:"Checks if a number is in the perfect cube numbers.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { perfect-cube? } = import("number-theory");\nperfect-cube?(7)','let { perfect-cube? } = import("number-theory");\nperfect-cube?(8)','let { perfect-cube? } = import("number-theory");\nperfect-cube?(9)'],seeAlso:["number-theory.perfect-cube-seq","number-theory.perfect-cube-nth","number-theory.perfect-square?","number-theory.perfect-power?","number-theory.perfect-cube-take-while","number-theory.perfect-power"]},"perfect-power-seq":{category:"number-theory",description:"Generates the perfect power numbers up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { perfect-power-seq } = import("number-theory");\nperfect-power-seq(5)','let { perfect-power-seq } = import("number-theory");\nperfect-power-seq(20)'],seeAlso:["number-theory.perfect-power-nth","number-theory.perfect-power-take-while","number-theory.perfect-power?","number-theory.perfect-power","number-theory.perfect-square-seq","number-theory.perfect-cube-seq"]},"perfect-power-take-while":{category:"number-theory",description:"Generates the perfect power numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { perfect-power-take-while } = import("number-theory");\nperfect-power-take-while(-> $ <= 100)'],seeAlso:["number-theory.perfect-power-seq","number-theory.perfect-power-nth","number-theory.perfect-power?"]},"perfect-power-nth":{category:"number-theory",description:"Generates the nth term of the perfect power numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { perfect-power-nth } = import("number-theory");\nperfect-power-nth(3)','let { perfect-power-nth } = import("number-theory");\nperfect-power-nth(15)'],seeAlso:["number-theory.perfect-power-seq","number-theory.perfect-power-take-while","number-theory.perfect-power?"]},"perfect-power?":{category:"number-theory",description:"Checks if a number is in the perfect power numbers.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { perfect-power? } = import("number-theory");\nperfect-power?(7)','let { perfect-power? } = import("number-theory");\nperfect-power?(8)','let { perfect-power? } = import("number-theory");\nperfect-power?(9)','let { perfect-power? } = import("number-theory");\nperfect-power?(10)'],seeAlso:["number-theory.perfect-power-seq","number-theory.perfect-power-nth","number-theory.perfect-power","number-theory.perfect-square?","number-theory.perfect-cube?","number-theory.perfect-power-take-while"]},"polygonal-seq":{category:"number-theory",description:"Generates the polygonal sequence for a given number of sides and length.",returns:{type:"integer",array:!0},args:{sides:{type:"integer",description:"The number of sides of the polygon."},length:{type:"integer",description:"The length of the sequence to generate."},a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["sides","length"]}],examples:['let { polygonal-seq } = import("number-theory");\npolygonal-seq(3, 2)','let { polygonal-seq } = import("number-theory");\npolygonal-seq(4, 2)','let { polygonal-seq } = import("number-theory");\npolygonal-seq(5, 3)','let { polygonal-seq } = import("number-theory");\npolygonal-seq(6, 5)','let { polygonal-seq } = import("number-theory");\npolygonal-seq(100, 10)'],seeAlso:["number-theory.polygonal-nth","number-theory.polygonal-take-while","number-theory.polygonal?","number-theory.perfect-square-seq"]},"polygonal-take-while":{category:"number-theory",description:"Generates the polygonal sequence while a condition is met.",returns:{type:"integer",array:!0},args:{sides:{type:"integer",description:"The number of sides of the polygon."},takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."},a:{type:"integer"},b:{type:"function"}},variants:[{argumentNames:["sides","takeWhile"]}],examples:['let { polygonal-take-while } = import("number-theory");\npolygonal-take-while(15, -> $ < 1000)'],seeAlso:["number-theory.polygonal-seq","number-theory.polygonal-nth","number-theory.polygonal?"]},"polygonal-nth":{category:"number-theory",description:"Generates the nth term of the polygonal sequence.",returns:{type:"integer"},args:{sides:{type:"integer",description:"The number of sides of the polygon."},n:{type:"integer",description:"The index of the term to generate."},a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["sides","n"]}],examples:['let { polygonal-nth } = import("number-theory");\npolygonal-nth(3, 9)','let { polygonal-nth } = import("number-theory");\npolygonal-nth(4, 5)','let { polygonal-nth } = import("number-theory");\npolygonal-nth(5, 5)'],seeAlso:["number-theory.polygonal-seq","number-theory.polygonal-take-while","number-theory.polygonal?"]},"polygonal?":{category:"number-theory",description:"Checks if a number is in the polygonal sequence.",returns:{type:"boolean"},args:{sides:{type:"integer",description:"The number of sides of the polygon."},n:{type:"integer",description:"The number to check."},a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["sides","n"]}],examples:['let { polygonal? } = import("number-theory");\npolygonal?(3, 10)','let { polygonal? } = import("number-theory");\npolygonal?(3, 9)','let { polygonal? } = import("number-theory");\npolygonal?(4, 10000)','let { polygonal? } = import("number-theory");\npolygonal?(4, 1000)','let { polygonal? } = import("number-theory");\npolygonal?(6, 45)'],seeAlso:["number-theory.polygonal-seq","number-theory.polygonal-nth","number-theory.perfect-square?","number-theory.polygonal-take-while"]},"prime-seq":{category:"number-theory",description:"Generates the prime sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { prime-seq } = import("number-theory");\nprime-seq(1)','let { prime-seq } = import("number-theory");\nprime-seq(2)','let { prime-seq } = import("number-theory");\nprime-seq(10)'],seeAlso:["number-theory.prime-nth","number-theory.prime-take-while","number-theory.prime?","number-theory.composite-seq","number-theory.mersenne-seq","number-theory.lucky-seq"]},"prime-take-while":{category:"number-theory",description:"Generates the prime sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { prime-take-while } = import("number-theory");\nprime-take-while(-> $ < 50)'],seeAlso:["number-theory.prime-seq","number-theory.prime-nth","number-theory.prime?"]},"prime-nth":{category:"number-theory",description:"Generates the nth term of the prime sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { prime-nth } = import("number-theory");\nprime-nth(1)','let { prime-nth } = import("number-theory");\nprime-nth(2)','let { prime-nth } = import("number-theory");\nprime-nth(10)'],seeAlso:["number-theory.prime-seq","number-theory.prime-take-while","number-theory.prime?"]},"prime?":{category:"number-theory",description:"Determines if a number is prime.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { prime? } = import("number-theory");\nprime?(1)','let { prime? } = import("number-theory");\nprime?(2)','let { prime? } = import("number-theory");\nprime?(3)','let { prime? } = import("number-theory");\nprime?(4)','let { prime? } = import("number-theory");\nprime?(997)','let { prime? } = import("number-theory");\nprime?(1001)'],seeAlso:["number-theory.prime-seq","number-theory.prime-nth","number-theory.composite?","number-theory.prime-factors","number-theory.mersenne?","number-theory.prime-take-while","number-theory.lucky?"]},"recaman-seq":{category:"number-theory",description:"Generates the Recaman sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { recaman-seq } = import("number-theory");\nrecaman-seq(5)','let { recaman-seq } = import("number-theory");\nrecaman-seq(10)','let { recaman-seq } = import("number-theory");\nrecaman-seq(20)'],seeAlso:["number-theory.recaman-nth","number-theory.recaman-take-while","number-theory.recaman?","number-theory.golomb-seq"]},"recaman-take-while":{category:"number-theory",description:"Generates the Recaman sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { recaman-take-while } = import("number-theory");\nrecaman-take-while(-> $ < 10)'],seeAlso:["number-theory.recaman-seq","number-theory.recaman-nth","number-theory.recaman?"]},"recaman-nth":{category:"number-theory",description:"Generates the nth term of the Recaman sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { recaman-nth } = import("number-theory");\nrecaman-nth(5)','let { recaman-nth } = import("number-theory");\nrecaman-nth(10)','let { recaman-nth } = import("number-theory");\nrecaman-nth(20)'],seeAlso:["number-theory.recaman-seq","number-theory.recaman-take-while","number-theory.recaman?"]},"recaman?":{category:"number-theory",description:"Checks if a number is in the Recaman sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { recaman? } = import("number-theory");\nrecaman?(5)','let { recaman? } = import("number-theory");\nrecaman?(10)','let { recaman? } = import("number-theory");\nrecaman?(20)'],seeAlso:["number-theory.recaman-seq","number-theory.recaman-nth","number-theory.recaman-take-while"]},"sylvester-seq":{category:"number-theory",description:"Generates the Sylvester sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 6 (the maximum length of the pre-calculated Sylvester numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { sylvester-seq } = import("number-theory");\nsylvester-seq(5)','let { sylvester-seq } = import("number-theory");\nsylvester-seq()','let { sylvester-seq } = import("number-theory");\nsylvester-seq()'],seeAlso:["number-theory.sylvester-nth","number-theory.sylvester-take-while","number-theory.sylvester?"]},"sylvester-take-while":{category:"number-theory",description:"Generates the Sylvester sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { sylvester-take-while } = import("number-theory");\nsylvester-take-while(-> $ < 100000)'],seeAlso:["number-theory.sylvester-seq","number-theory.sylvester-nth","number-theory.sylvester?"]},"sylvester-nth":{category:"number-theory",description:"Generates the nth term of the Sylvester sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { sylvester-nth } = import("number-theory");\nsylvester-nth(1)','let { sylvester-nth } = import("number-theory");\nsylvester-nth(5)'],seeAlso:["number-theory.sylvester-seq","number-theory.sylvester-take-while","number-theory.sylvester?"]},"sylvester?":{category:"number-theory",description:"Checks if a number is in the Sylvester sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { sylvester? } = import("number-theory");\nsylvester?(2)','let { sylvester? } = import("number-theory");\nsylvester?(3)','let { sylvester? } = import("number-theory");\nsylvester?(6)'],seeAlso:["number-theory.sylvester-seq","number-theory.sylvester-nth","number-theory.sylvester-take-while"]},"thue-morse-seq":{category:"number-theory",description:"Generates the Thue-Morse sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { thue-morse-seq } = import("number-theory");\nthue-morse-seq(5)','let { thue-morse-seq } = import("number-theory");\nthue-morse-seq(10)','let { thue-morse-seq } = import("number-theory");\nthue-morse-seq(20)'],seeAlso:["number-theory.thue-morse-nth","number-theory.thue-morse-take-while","number-theory.thue-morse?"]},"thue-morse-take-while":{category:"number-theory",description:"Generates the Thue-Morse sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { thue-morse-take-while } = import("number-theory");\nthue-morse-take-while(-> $2 < 10)'],seeAlso:["number-theory.thue-morse-seq","number-theory.thue-morse-nth","number-theory.thue-morse?"]},"thue-morse-nth":{category:"number-theory",description:"Generates the nth term of the Thue-Morse sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term in the sequence."}},variants:[{argumentNames:["n"]}],examples:['let { thue-morse-nth } = import("number-theory");\nthue-morse-nth(5)','let { thue-morse-nth } = import("number-theory");\nthue-morse-nth(10)','let { thue-morse-nth } = import("number-theory");\nthue-morse-nth(20)'],seeAlso:["number-theory.thue-morse-seq","number-theory.thue-morse-take-while","number-theory.thue-morse?"]},"thue-morse?":{category:"number-theory",description:"Checks if a number is part of the Thue-Morse sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { thue-morse? } = import("number-theory");\nthue-morse?(1)','let { thue-morse? } = import("number-theory");\nthue-morse?(2)'],seeAlso:["number-theory.thue-morse-seq","number-theory.thue-morse-nth","number-theory.thue-morse-take-while"]},"tribonacci-seq":{category:"number-theory",description:"Generates the tribonacci sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { tribonacci-seq } = import("number-theory");\ntribonacci-seq(1)','let { tribonacci-seq } = import("number-theory");\ntribonacci-seq(2)','let { tribonacci-seq } = import("number-theory");\ntribonacci-seq(10)'],seeAlso:["number-theory.tribonacci-nth","number-theory.tribonacci-take-while","number-theory.tribonacci?","number-theory.fibonacci-seq"]},"tribonacci-take-while":{category:"number-theory",description:"Generates the tribonacci sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { tribonacci-take-while } = import("number-theory");\ntribonacci-take-while(-> $ < 100)'],seeAlso:["number-theory.tribonacci-seq","number-theory.tribonacci-nth","number-theory.tribonacci?"]},"tribonacci-nth":{category:"number-theory",description:"Generates the nth term of the tribonacci sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { tribonacci-nth } = import("number-theory");\ntribonacci-nth(1)','let { tribonacci-nth } = import("number-theory");\ntribonacci-nth(2)','let { tribonacci-nth } = import("number-theory");\ntribonacci-nth(10)'],seeAlso:["number-theory.tribonacci-seq","number-theory.tribonacci-take-while","number-theory.tribonacci?"]},"tribonacci?":{category:"number-theory",description:"Determines if a number is in the tribonacci sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { tribonacci? } = import("number-theory");\ntribonacci?(0)','let { tribonacci? } = import("number-theory");\ntribonacci?(1)','let { tribonacci? } = import("number-theory");\ntribonacci?(2)','let { tribonacci? } = import("number-theory");\ntribonacci?(3)','let { tribonacci? } = import("number-theory");\ntribonacci?(4)','let { tribonacci? } = import("number-theory");\ntribonacci?(5)','let { tribonacci? } = import("number-theory");\ntribonacci?(6)','let { tribonacci? } = import("number-theory");\ntribonacci?(7)','let { tribonacci? } = import("number-theory");\ntribonacci?(8)','let { tribonacci? } = import("number-theory");\ntribonacci?(9)','let { tribonacci? } = import("number-theory");\ntribonacci?(10)'],seeAlso:["number-theory.tribonacci-seq","number-theory.tribonacci-nth","number-theory.fibonacci?","number-theory.tribonacci-take-while"]},"count-combinations":{category:"number-theory",description:"Calculates the number of combinations of n items taken k at a time.",returns:{type:"integer"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:['let { count-combinations } = import("number-theory");\ncount-combinations(5, 3)','let { count-combinations } = import("number-theory");\ncount-combinations(10, 2)'],seeAlso:["number-theory.combinations","number-theory.count-permutations","number-theory.factorial","number-theory.multinomial","number-theory.stirling-second","number-theory.count-partitions","number-theory.count-power-set"]},combinations:{category:"number-theory",description:"Generates all possible combinations of a specified size from a collection.",returns:{type:"array",array:!0},args:{set:{type:"array",array:!0,description:"The input collection to generate combinations from."},n:{type:"integer",description:"The size of each combination."},a:{type:"array"},b:{type:"integer"}},variants:[{argumentNames:["set","n"]}],examples:['let { combinations } = import("number-theory");\ncombinations([1, 2, 3], 2)','let { combinations } = import("number-theory");\ncombinations(["a", "b", "c"], 2)','let { combinations } = import("number-theory");\ncombinations([1, 2, 3], 0)','let { combinations } = import("number-theory");\ncombinations([1, 2, 3], 1)','let { combinations } = import("number-theory");\ncombinations([1, 2, 3], 3)'],seeAlso:["number-theory.count-combinations","number-theory.permutations","number-theory.power-set","number-theory.cartesian-product","number-theory.partitions"]},"count-derangements":{category:"number-theory",description:"Calculates the number of derangements (permutations where no element appears in its original position) of n items.",returns:{type:"integer"},args:{n:{type:"integer",description:"The total number of items."}},variants:[{argumentNames:["n"]}],examples:['let { count-derangements } = import("number-theory");\ncount-derangements(4)','let { count-derangements } = import("number-theory");\ncount-derangements(5)'],seeAlso:["number-theory.derangements","number-theory.count-permutations","number-theory.factorial"]},derangements:{category:"number-theory",description:"Generates all derangements (permutations where no element appears in its original position) of a set.",returns:{type:"array",array:!0},args:{set:{type:"array",array:!0,description:"The input collection to generate derangements from."}},variants:[{argumentNames:["set"]}],examples:['let { derangements } = import("number-theory");\nderangements([1, 2, 3, 4])','let { derangements } = import("number-theory");\nderangements(["a", "b", "c"])'],seeAlso:["number-theory.count-derangements","number-theory.permutations"]},divisors:{category:"number-theory",description:"Returns the divisors of a number.",returns:{type:"integer",array:!0},args:{n:{type:"integer",description:"The number to find divisors for."}},variants:[{argumentNames:["n"]}],examples:['let { divisors } = import("number-theory");\ndivisors(12)','let { divisors } = import("number-theory");\ndivisors(100)','let { divisors } = import("number-theory");\ndivisors(37)'],seeAlso:["number-theory.count-divisors","number-theory.proper-divisors","number-theory.sigma","number-theory.prime-factors","number-theory.divisible-by?","number-theory.lcm","number-theory.abundant?","number-theory.deficient?","number-theory.count-proper-divisors"]},"count-divisors":{category:"number-theory",description:"Returns the number of divisors of a number.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to count divisors for."}},variants:[{argumentNames:["n"]}],examples:['let { count-divisors } = import("number-theory");\ncount-divisors(12)','let { count-divisors } = import("number-theory");\ncount-divisors(100)','let { count-divisors } = import("number-theory");\ncount-divisors(37)'],seeAlso:["number-theory.divisors","number-theory.count-proper-divisors","number-theory.sigma"]},"proper-divisors":{category:"number-theory",description:"Returns the proper divisors of a number.",returns:{type:"integer",array:!0},args:{n:{type:"integer",description:"The number to find proper divisors for."}},variants:[{argumentNames:["n"]}],examples:['let { proper-divisors } = import("number-theory");\nproper-divisors(12)','let { proper-divisors } = import("number-theory");\nproper-divisors(100)','let { proper-divisors } = import("number-theory");\nproper-divisors(37)'],seeAlso:["number-theory.count-proper-divisors","number-theory.divisors","number-theory.amicable?","number-theory.perfect?"]},"count-proper-divisors":{category:"number-theory",description:"Returns the number of proper divisors of a number.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to count proper divisors for."}},variants:[{argumentNames:["n"]}],examples:['let { count-proper-divisors } = import("number-theory");\ncount-proper-divisors(12)','let { count-proper-divisors } = import("number-theory");\ncount-proper-divisors(100)','let { count-proper-divisors } = import("number-theory");\ncount-proper-divisors(37)'],seeAlso:["number-theory.proper-divisors","number-theory.count-divisors","number-theory.divisors"]},factorial:{category:"number-theory",description:"Calculates the factorial of a number.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to calculate the factorial for."}},variants:[{argumentNames:["n"]}],examples:['let { factorial } = import("number-theory");\nfactorial(5)','let { factorial } = import("number-theory");\nfactorial(0)','let { factorial } = import("number-theory");\nfactorial(10)','let { factorial } = import("number-theory");\nfactorial(20)'],seeAlso:["number-theory.factorial-seq","number-theory.factorial-nth","number-theory.factorial?","number-theory.count-combinations","number-theory.count-permutations","number-theory.multinomial","number-theory.count-derangements"]},partitions:{category:"number-theory",description:"Generates all partitions of a number.",returns:{type:"array",array:!0},args:{n:{type:"integer",description:"The number to partition."}},variants:[{argumentNames:["n"]}],examples:['let { partitions } = import("number-theory");\npartitions(4)','let { partitions } = import("number-theory");\npartitions(8)'],seeAlso:["number-theory.count-partitions","number-theory.partition-seq","number-theory.combinations","number-theory.partition?"]},"count-partitions":{category:"number-theory",description:"Returns the number of partitions of a number.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to count partitions for."}},variants:[{argumentNames:["n"]}],examples:['let { count-partitions } = import("number-theory");\ncount-partitions(4)','let { count-partitions } = import("number-theory");\ncount-partitions(8)','let { count-partitions } = import("number-theory");\ncount-partitions(15)'],seeAlso:["number-theory.partitions","number-theory.partition-seq","number-theory.count-combinations"]},permutations:{category:"number-theory",description:"Generates all permutations of a collection.",returns:{type:"array",array:!0},args:{set:{type:"array",array:!0,description:"The input collection to generate permutations from."}},variants:[{argumentNames:["set"]}],examples:['let { permutations } = import("number-theory");\npermutations([1, 2, 3])','let { permutations } = import("number-theory");\npermutations(["a", "b", "c"])','let { permutations } = import("number-theory");\npermutations([1, 2, 3, 4])','let { permutations } = import("number-theory");\npermutations([1, 2])','let { permutations } = import("number-theory");\npermutations([1])','let { permutations } = import("number-theory");\npermutations([])'],seeAlso:["number-theory.count-permutations","number-theory.combinations","number-theory.derangements","number-theory.cartesian-product"]},"count-permutations":{category:"number-theory",description:"Returns the number of permutations of n items taken k at a time.",returns:{type:"integer"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:['let { count-permutations } = import("number-theory");\ncount-permutations(5, 3)','let { count-permutations } = import("number-theory");\ncount-permutations(10, 2)','let { count-permutations } = import("number-theory");\ncount-permutations(10, 10)','let { count-permutations } = import("number-theory");\ncount-permutations(10, 0)','let { count-permutations } = import("number-theory");\ncount-permutations(10, 1)'],seeAlso:["number-theory.permutations","number-theory.count-combinations","number-theory.factorial","number-theory.multinomial","number-theory.stirling-first","number-theory.count-derangements"]},"power-set":{category:"number-theory",description:"Generates the power set of a collection.",returns:{type:"array",array:!0},args:{set:{type:"any",array:!0,description:"The input collection to generate the power set from."}},variants:[{argumentNames:["set"]}],examples:['let { power-set } = import("number-theory");\npower-set(["a", "b", "c"])','let { power-set } = import("number-theory");\npower-set([1, 2])','let { power-set } = import("number-theory");\npower-set([1])','let { power-set } = import("number-theory");\npower-set([])'],seeAlso:["number-theory.count-power-set","number-theory.combinations","number-theory.cartesian-product"]},"count-power-set":{category:"number-theory",description:"Returns the number of subsets of a set.",returns:{type:"integer"},args:{n:{type:"integer",description:"The size of the set."}},variants:[{argumentNames:["n"]}],examples:['let { count-power-set } = import("number-theory");\ncount-power-set(3)','let { count-power-set } = import("number-theory");\ncount-power-set(5)','let { count-power-set } = import("number-theory");\ncount-power-set(10)'],seeAlso:["number-theory.power-set","number-theory.count-combinations"]},"prime-factors":{category:"number-theory",description:"Returns the prime factors of a number.",returns:{type:"integer",array:!0},args:{n:{type:"integer",description:"The number to factor."}},variants:[{argumentNames:["n"]}],examples:['let { prime-factors } = import("number-theory");\nprime-factors(12)','let { prime-factors } = import("number-theory");\nprime-factors(100)','let { prime-factors } = import("number-theory");\nprime-factors(37)'],seeAlso:["number-theory.count-prime-factors","number-theory.distinct-prime-factors","number-theory.prime?","number-theory.divisors","number-theory.euler-totient","number-theory.mobius","number-theory.composite?","number-theory.count-distinct-prime-factors"]},"count-prime-factors":{category:"number-theory",description:"Returns the number of prime factors of a number.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to count prime factors for."}},variants:[{argumentNames:["n"]}],examples:['let { count-prime-factors } = import("number-theory");\ncount-prime-factors(12)','let { count-prime-factors } = import("number-theory");\ncount-prime-factors(100)','let { count-prime-factors } = import("number-theory");\ncount-prime-factors(37)'],seeAlso:["number-theory.prime-factors","number-theory.distinct-prime-factors","number-theory.count-distinct-prime-factors"]},"distinct-prime-factors":{category:"number-theory",description:"Returns the distinct prime factors of a number.",returns:{type:"integer",array:!0},args:{n:{type:"integer",description:"The number to find distinct prime factors for."}},variants:[{argumentNames:["n"]}],examples:['let { distinct-prime-factors } = import("number-theory");\ndistinct-prime-factors(12)','let { distinct-prime-factors } = import("number-theory");\ndistinct-prime-factors(100)','let { distinct-prime-factors } = import("number-theory");\ndistinct-prime-factors(37)'],seeAlso:["number-theory.prime-factors","number-theory.count-distinct-prime-factors","number-theory.count-prime-factors"]},"count-distinct-prime-factors":{category:"number-theory",description:"Returns the number of distinct prime factors of a number.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to count distinct prime factors for."}},variants:[{argumentNames:["n"]}],examples:['let { count-distinct-prime-factors } = import("number-theory");\ncount-distinct-prime-factors(12)','let { count-distinct-prime-factors } = import("number-theory");\ncount-distinct-prime-factors(100)','let { count-distinct-prime-factors } = import("number-theory");\ncount-distinct-prime-factors(37)'],seeAlso:["number-theory.distinct-prime-factors","number-theory.prime-factors","number-theory.count-prime-factors"]},"coprime?":{category:"number-theory",description:"Checks if two numbers are coprime (i.e., their GCD is 1).",returns:{type:"boolean"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:['let { coprime? } = import("number-theory");\ncoprime?(12, 8)','let { coprime? } = import("number-theory");\ncoprime?(12, 5)','let { coprime? } = import("number-theory");\ncoprime?(37, 1)','let { coprime? } = import("number-theory");\ncoprime?(0, 0)','let { coprime? } = import("number-theory");\ncoprime?(0, 5)','let { coprime? } = import("number-theory");\ncoprime?(5, 0)','let { coprime? } = import("number-theory");\ncoprime?(1, 0)','let { coprime? } = import("number-theory");\ncoprime?(0, 1)','let { coprime? } = import("number-theory");\ncoprime?(1, 1)','let { coprime? } = import("number-theory");\ncoprime?(2, 3)'],seeAlso:["number-theory.gcd","number-theory.euler-totient","number-theory.divisible-by?","number-theory.lcm","number-theory.carmichael-lambda"]},"divisible-by?":{category:"number-theory",description:"Checks if a number is divisible by another number.",returns:{type:"boolean"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:['let { divisible-by? } = import("number-theory");\ndivisible-by?(12, 4)','let { divisible-by? } = import("number-theory");\ndivisible-by?(12, 5)','let { divisible-by? } = import("number-theory");\ndivisible-by?(37, 1)','let { divisible-by? } = import("number-theory");\ndivisible-by?(0, 0)','let { divisible-by? } = import("number-theory");\ndivisible-by?(0, 5)','let { divisible-by? } = import("number-theory");\ndivisible-by?(5, 0)'],seeAlso:["number-theory.divisors","number-theory.gcd","number-theory.coprime?"]},gcd:{category:"number-theory",description:"Calculates the greatest common divisor (GCD) of two numbers.",returns:{type:"integer"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:['let { gcd } = import("number-theory");\ngcd(100, 25)','let { gcd } = import("number-theory");\ngcd(37, 1)','let { gcd } = import("number-theory");\ngcd(0, 0)','let { gcd } = import("number-theory");\ngcd(0, 5)','let { gcd } = import("number-theory");\ngcd(5, 0)'],seeAlso:["number-theory.lcm","number-theory.extended-gcd","number-theory.coprime?","number-theory.divisible-by?"]},lcm:{category:"number-theory",description:"Calculates the least common multiple (LCM) of two numbers.",returns:{type:"integer"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:['let { lcm } = import("number-theory");\nlcm(100, 25)','let { lcm } = import("number-theory");\nlcm(37, 1)','let { lcm } = import("number-theory");\nlcm(0, 5)','let { lcm } = import("number-theory");\nlcm(5, 0)'],seeAlso:["number-theory.gcd","number-theory.divisors","number-theory.coprime?"]},multinomial:{category:"number-theory",description:"Calculates the multinomial coefficient from of a list of numbers representing the sizes of each group.",returns:{type:"integer"},args:{args:{type:"integer",rest:!0,description:"The numbers representing the sizes of each group."}},variants:[{argumentNames:["args"]}],examples:['let { multinomial } = import("number-theory");\nmultinomial(5, 2, 3)','let { multinomial } = import("number-theory");\nmultinomial(10, 2, 3, 5)'],seeAlso:["number-theory.count-combinations","number-theory.factorial","number-theory.count-permutations"],hideOperatorForm:!0},"amicable?":{category:"number-theory",description:"Checks if two numbers are amicable (i.e., the sum of the proper divisors of each number equals the other number).",returns:{type:"boolean"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:['let { amicable? } = import("number-theory");\namicable?(220, 284)','let { amicable? } = import("number-theory");\namicable?(1184, 1210)','let { amicable? } = import("number-theory");\namicable?(2620, 2924)','let { amicable? } = import("number-theory");\namicable?(5020, 5564)','let { amicable? } = import("number-theory");\namicable?(6232, 6368)'],seeAlso:["number-theory.proper-divisors","number-theory.perfect?","number-theory.sigma","number-theory.perfect-seq"]},"euler-totient":{category:"number-theory",description:"Calculates the Euler's totient function (φ(n)) of a number, which counts the integers up to n that are coprime to n.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to calculate the totient for."}},variants:[{argumentNames:["n"]}],examples:['let { euler-totient } = import("number-theory");\neuler-totient(1)','let { euler-totient } = import("number-theory");\neuler-totient(2)','let { euler-totient } = import("number-theory");\neuler-totient(10)','let { euler-totient } = import("number-theory");\neuler-totient(20)'],seeAlso:["number-theory.coprime?","number-theory.carmichael-lambda","number-theory.mobius","number-theory.prime-factors","number-theory.mertens"]},mobius:{category:"number-theory",description:"Calculates the Möbius function (μ(n)) of a number, which is used in number theory.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to calculate the Möbius function for."}},variants:[{argumentNames:["n"]}],examples:['let { mobius } = import("number-theory");\nmobius(1)','let { mobius } = import("number-theory");\nmobius(2)','let { mobius } = import("number-theory");\nmobius(3)','let { mobius } = import("number-theory");\nmobius(4)','let { mobius } = import("number-theory");\nmobius(6)','let { mobius } = import("number-theory");\nmobius(12)','let { mobius } = import("number-theory");\nmobius(30)'],seeAlso:["number-theory.mertens","number-theory.euler-totient","number-theory.prime-factors"]},mertens:{category:"number-theory",description:"Calculates the Mertens function (M(n)) of a number, which is the sum of the Möbius function up to n.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to calculate the Mertens function for."}},variants:[{argumentNames:["n"]}],examples:['let { mobius } = import("number-theory");\nmobius(1)','let { mobius } = import("number-theory");\nmobius(2)','let { mobius } = import("number-theory");\nmobius(3)','let { mobius } = import("number-theory");\nmobius(4)','let { mobius } = import("number-theory");\nmobius(6)','let { mobius } = import("number-theory");\nmobius(12)','let { mobius } = import("number-theory");\nmobius(30)'],seeAlso:["number-theory.mobius","number-theory.euler-totient"]},sigma:{category:"number-theory",description:"Calculates the sum of divisors function (σ(n)) of a number, which is the sum of all positive divisors of n.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to calculate the sum of divisors for."}},variants:[{argumentNames:["n"]}],examples:['let { sigma } = import("number-theory");\nsigma(1)','let { sigma } = import("number-theory");\nsigma(2)','let { sigma } = import("number-theory");\nsigma(3)','let { sigma } = import("number-theory");\nsigma(4)','let { sigma } = import("number-theory");\nsigma(6)','let { sigma } = import("number-theory");\nsigma(12)','let { sigma } = import("number-theory");\nsigma(30)'],seeAlso:["number-theory.divisors","number-theory.perfect?","number-theory.abundant?","number-theory.deficient?","number-theory.amicable?","number-theory.count-divisors"]},"carmichael-lambda":{category:"number-theory",description:"Calculates the Carmichael function (λ(n)) of a number, which is the smallest positive integer m such that a^m ≡ 1 (mod n) for all integers a coprime to n.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to calculate the Carmichael function for."}},variants:[{argumentNames:["n"]}],examples:['let { carmichael-lambda } = import("number-theory");\ncarmichael-lambda(1)','let { carmichael-lambda } = import("number-theory");\ncarmichael-lambda(2)','let { carmichael-lambda } = import("number-theory");\ncarmichael-lambda(3)','let { carmichael-lambda } = import("number-theory");\ncarmichael-lambda(4)','let { carmichael-lambda } = import("number-theory");\ncarmichael-lambda(6)','let { carmichael-lambda } = import("number-theory");\ncarmichael-lambda(12)','let { carmichael-lambda } = import("number-theory");\ncarmichael-lambda(30)'],seeAlso:["number-theory.euler-totient","number-theory.mod-exp","number-theory.coprime?"]},"cartesian-product":{category:"number-theory",description:"Calculates the Cartesian product of two or more sets.",returns:{type:"array",array:!0},args:{sets:{type:"array",array:!0,description:"The input collections to calculate the Cartesian product from."},a:{type:"array"},b:{type:"array"}},variants:[{argumentNames:["sets"]}],examples:['let { cartesian-product } = import("number-theory");\ncartesian-product([1, 2], ["a", "b"])','let { cartesian-product } = import("number-theory");\ncartesian-product([1, 2], ["a", "b"], [true, false])','let { cartesian-product } = import("number-theory");\ncartesian-product([1, 2, 3], ["x", "y", "z"])'],seeAlso:["number-theory.combinations","number-theory.power-set","number-theory.permutations"]},"perfect-power":{category:"number-theory",description:"Returns a tuple of the base and exponent if the number is a perfect power, otherwise returns null.",returns:{type:"array",array:!0},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { perfect-power } = import("number-theory");\nperfect-power(1)','let { perfect-power } = import("number-theory");\nperfect-power(2)','let { perfect-power } = import("number-theory");\nperfect-power(4)','let { perfect-power } = import("number-theory");\nperfect-power(8)','let { perfect-power } = import("number-theory");\nperfect-power(9)','let { perfect-power } = import("number-theory");\nperfect-power(16)','let { perfect-power } = import("number-theory");\nperfect-power(19)'],seeAlso:["number-theory.perfect-power?","number-theory.perfect-power-seq","number-theory.perfect-square?","number-theory.perfect-cube?"]},"mod-exp":{category:"number-theory",description:"Calculates the modular exponentiation of a base raised to an exponent modulo a modulus.",returns:{type:"integer"},args:{base:{type:"integer"},exponent:{type:"integer"},modulus:{type:"integer"}},variants:[{argumentNames:["base","exponent","modulus"]}],examples:['let { mod-exp } = import("number-theory");\nmod-exp(2, 3, 5)','let { mod-exp } = import("number-theory");\nmod-exp(3, 4, 7)','let { mod-exp } = import("number-theory");\nmod-exp(5, 6, 11)','let { mod-exp } = import("number-theory");\nmod-exp(7, 8, 13)'],seeAlso:["number-theory.mod-inv","number-theory.carmichael-lambda","number-theory.chinese-remainder"]},"mod-inv":{category:"number-theory",description:"Calculates the modular multiplicative inverse of a number modulo another number.",returns:{type:"integer"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","m"]}],examples:['let { mod-inv } = import("number-theory");\nmod-inv(3, 11)','let { mod-inv } = import("number-theory");\nmod-inv(10, 17)','let { mod-inv } = import("number-theory");\nmod-inv(5, 13)','let { mod-inv } = import("number-theory");\nmod-inv(7, 19)'],seeAlso:["number-theory.mod-exp","number-theory.extended-gcd","number-theory.chinese-remainder"]},"extended-gcd":{category:"number-theory",description:"Calculates the extended greatest common divisor (GCD) of two numbers, returning the GCD and the coefficients of Bézout's identity.",returns:{type:"integer",array:!0},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:['let { extended-gcd } = import("number-theory");\nextended-gcd(30, 12)','let { extended-gcd } = import("number-theory");\nextended-gcd(56, 98)','let { extended-gcd } = import("number-theory");\nextended-gcd(101, 10)','let { extended-gcd } = import("number-theory");\nextended-gcd(17, 13)'],seeAlso:["number-theory.gcd","number-theory.mod-inv","number-theory.chinese-remainder"]},"chinese-remainder":{category:"number-theory",description:"Solves a system of simultaneous congruences using the Chinese Remainder Theorem.",returns:{type:"integer"},args:{remainders:{type:"integer",array:!0,description:"The remainders of the congruences."},moduli:{type:"integer",array:!0,description:"The moduli of the congruences."},a:{type:"array"},b:{type:"array"}},variants:[{argumentNames:["remainders","moduli"]}],examples:['let { chinese-remainder } = import("number-theory");\nchinese-remainder([2, 3], [3, 5])','let { chinese-remainder } = import("number-theory");\nchinese-remainder([1, 2], [3, 4])','let { chinese-remainder } = import("number-theory");\nchinese-remainder([0, 1], [2, 3])','let { chinese-remainder } = import("number-theory");\nchinese-remainder([1, 2, 3], [4, 5, 7])'],seeAlso:["number-theory.mod-exp","number-theory.mod-inv","number-theory.extended-gcd"]},"stirling-first":{category:"number-theory",description:"Calculates the Stirling numbers of the first kind, which count the number of permutations of n elements with k cycles.",returns:{type:"integer"},args:{a:{type:"integer",description:"The number of elements."},b:{type:"integer",description:"The number of cycles."}},variants:[{argumentNames:["a","b"]}],examples:['let { stirling-first } = import("number-theory");\nstirling-first(5, 2)','let { stirling-first } = import("number-theory");\nstirling-first(4, 3)','let { stirling-first } = import("number-theory");\nstirling-first(6, 1)','let { stirling-first } = import("number-theory");\nstirling-first(7, 4)','let { stirling-first } = import("number-theory");\nstirling-first(8, 5)'],seeAlso:["number-theory.stirling-second","number-theory.bell-seq","number-theory.count-permutations"]},"stirling-second":{category:"number-theory",description:"Calculates the Stirling numbers of the second kind, which count the number of ways to partition n elements into k non-empty subsets.",returns:{type:"integer"},args:{a:{type:"integer",description:"The number of elements."},b:{type:"integer",description:"The number of subsets."}},variants:[{argumentNames:["a","b"]}],examples:['let { stirling-second } = import("number-theory");\nstirling-second(5, 2)','let { stirling-second } = import("number-theory");\nstirling-second(4, 3)','let { stirling-second } = import("number-theory");\nstirling-second(6, 1)','let { stirling-second } = import("number-theory");\nstirling-second(7, 4)','let { stirling-second } = import("number-theory");\nstirling-second(8, 5)'],seeAlso:["number-theory.stirling-first","number-theory.bell-seq","number-theory.count-combinations"]}};function N(e,t){if(0===t||t===e)return 1;let r=1;for(let n=0;n<t;n++)r*=(e-n)/(n+1);return r}function T(e,t){if(1===t)return e.map(e=>[e]);const r=[];for(let n=0;n<=e.length-t;n++){const o=e[n],i=T(e.slice(n+1),t-1);for(const e of i)r.push([o,...e])}return r}const G={combinations:{evaluate:([e,t],r)=>(d(e,r),l(t,r,{integer:!0,nonNegative:!0,lte:e.length}),0===t?[[]]:T(e,t)),arity:x(2)},"count-combinations":{evaluate:([e,t],r)=>(l(e,r,{integer:!0,nonNegative:!0}),l(t,r,{integer:!0,nonNegative:!0,lte:e}),N(e,t)),arity:x(2)}};const $={derangements:{evaluate:([e],t)=>(d(e,t),function(e){const t=e.length,r=[],n=Array.from({length:t},()=>!1),o=Array.from({length:t});return function i(a){if(a!==t)for(let r=0;r<t;r++)n[r]||r===a||(n[r]=!0,o[a]=e[r],i(a+1),n[r]=!1);else r.push([...o])}(0),r}(e)),arity:x(1)},"count-derangements":{evaluate:([e],t)=>(l(e,t,{finite:!0,integer:!0,positive:!0}),function(e){if(1===e)return 0;let t=1,r=0,n=0;for(let o=2;o<=e;o++)n=(o-1)*(t+r),t=r,r=n;return n}(e)),arity:x(1)}};function C(e){const t=[];for(let r=1;r<=Math.sqrt(e);r++)e%r===0&&(t.push(r),r!==e/r&&t.push(e/r));return t}function W(e){return C(e).sort((e,t)=>e-t)}function M(e){return W(e).slice(0,-1)}const S={divisors:{evaluate:([e],t)=>(l(e,t,{finite:!0,integer:!0,positive:!0}),W(e)),arity:x(1)},"count-divisors":{evaluate:([e],t)=>(l(e,t,{finite:!0,integer:!0,positive:!0}),C(e).length),arity:x(1)},"proper-divisors":{evaluate:([e],t)=>(l(e,t,{finite:!0,integer:!0,positive:!0}),M(e)),arity:x(1)},"count-proper-divisors":{evaluate:([e],t)=>(l(e,t,{finite:!0,integer:!0,positive:!0}),C(e).length-1),arity:x(1)}},E=[1,1,2,6,24,120,720,5040,40320,362880,3628800,39916800,479001600,6227020800,87178291200,1307674368e3,20922789888e3,355687428096e3,6402373705728e3];function R(e){if(e<0)throw new Error("Factorial is not defined for negative numbers");if(0===e||1===e)return 1;if(e<=18)return E[e];let t=E[18];for(let r=19;r<=e;r++)t*=r;return t}const I={factorial:{evaluate:([e],t)=>(l(e,t,{integer:!0,nonNegative:!0,lte:170}),R(e)),arity:x(1)}},z=[1,2,3,5,7,11,15,22,30,42,56,77,101,135,176,231,297,385,490,627,792,1002,1255,1575,1958,2436,3010,3718,4565,5604,6842,8349,10143,12310,14883,17977,21637,26015,31185,37338,44583,53174,63261,75175,89134,105558,124754,147273,173525,204226,239943,281589,329931,386155,451276,526823,614154,715220,831820,966467,1121505,1300156,1505499,1741630,2012558,2323520,2679689,3087735,3554345,4087968,4697205,5392783,6185689,7089500,8118264,9289091,10619863,12132164,13848650,15796476,18004327,20506255,23338469,26543660,30167357,34262962,38887673,44108109,49995925,56634173,64112359,72533807,82010177,92669720,104651419,118114304,133230930,150198136,169229875,190569292,214481126,241265379,271248950,304801365,342325709,384276336,431149389,483502844,541946240,607163746,679903203,761002156,851376628,952050665,1064144451,1188908248,1327710076,1482074143,1653668665,1844349560,2056148051,2291320912,2552338241,2841940500,3163127352,3519222692,3913864295,4351078600,4835271870,5371315400,5964539504,6620830889,7346629512,8149040695,9035836076,10015581680,11097645016,12292341831,13610949895,15065878135,16670689208,18440293320,20390982757,22540654445,24908858009,27517052599,30388671978,33549419497,37027355200,40853235313,45060624582,49686288421,54770336324,60356673280,66493182097,73232243759,80630964769,88751778802,97662728555,107438159466,118159068427,129913904637,142798995930,156919475295,172389800255,189334822579,207890420102,228204732751,250438925115,274768617130,301384802048,330495499613,362326859895,397125074750,435157697830,476715857290,522115831195,571701605655,625846753120,684957390936,749474411781,819876908323,896684817527,980462880430,0xf98dace281,1171432692373,1280011042268,1398341745571,1527273599625,1667727404093,1820701100652,1987276856363,2168627105469,2366022741845,2580840212973,2814570987591,3068829878530,3345365983698,3646072432125,3972999029388,4328363658647,4714566886083,5134205287973,5590088317495,6085253859260,6622987708040,7206841706490,7840656226137,8528581302375,9275102575355,0x92c1cc50847,0x9f8afdf968b,0xad6918d4f36,0xbc72dde1287,0xccc0de0d1d7,0xde6da02b061,0xf195c5ba10a,18028182516671,19573856161145,21248279009367,23061871173849,25025873760111,27152408925615,29454549941750,31946390696157,34643126322519,37561133582570,40718063627362,44132934884255,47826239745920,51820051838712,56138148670947,60806135438329,65851585970275,71304185514919,77195892663512,83561103925871,90436839668817,97862933703585,0x604ca1b434ad,0x682ca0bc6d4e,0x70ad06a4328b,0x79da3e8e4df8,0x83c1a359c63d,0x8e7190d8114a,0x99f976fff202,0xa669edb53a4a,0xb3d4caca1bc8,0xc24d38b78151,0xd1e7cfd30909,0xe2bab064772f,0xf4dd9f8523e3,290726957916112,313891991306665,338854264248680,365749566870782,394723676655357,425933084409356,459545750448675,495741934760846,534715062908609,576672674947168,621837416509615,670448123060170,722760953690372,779050629562167,839611730366814,904760108316360,974834369944625,0x3bb262854d36d,0x404dafd2efa2e,0x4541ae2536f6d,0x4a94ddd83ba57,0x504e363fd1eca,0x56752ddfc97e7,0x5d11c356f6b53,0x642c86bff69f5,0x6bcea3db036a0,0x7401ecbfdbd63,0x7cd0e571c49d4,0x8646d010a1b6f,0x906fba0855202,0x9b5889f52508f,0xa70f0ea631153,0xb3a20ef033ec5,0xc1215ac210755,0xcf9ddd28cfa8d,0xdf29afbd9f60e,0xefd82f26a7157,4534253126900886,4872038056472084,5234371069753672,5622992691950605,6039763882095515,6486674127079088,6965850144195831,7479565078510584,8030248384943040,8620496275465025];const j={partitions:{evaluate:([e],t)=>(l(e,t,{integer:!0,nonNegative:!0}),function(e){if(e<=0)return[[]];if(1===e)return[[1]];const t=[];return function e(r,n,o){if(0!==r)for(let t=Math.min(n,r);t>=1;t--)o.push(t),e(r-t,t,o),o.pop();else t.push([...o])}(e,e,[]),t}(e)),arity:x(1)},"count-partitions":{evaluate:([e],r)=>{if(l(e,r,{integer:!0,nonNegative:!0}),0===e)return 1;if(e>z.length)throw new t(`n is too large. The maximum value is ${z.length-1}.`,r);return z[e-1]},arity:x(1)}};function D(e){if(0===e.length)return[[]];const t=[];for(let r=0;r<e.length;r++){const n=e[r],o=D([...e.slice(0,r),...e.slice(r+1)]);for(const e of o)t.push([n,...e])}return t}const P={permutations:{evaluate:([e],t)=>(d(e,t),D(e)),arity:x(1)},"count-permutations":{evaluate:([e,t],r)=>(l(e,r,{integer:!0,nonNegative:!0}),l(t,r,{integer:!0,nonNegative:!0,lte:e}),R(e)/R(e-t)),arity:x(2)}};const F={"power-set":{evaluate:([e],t)=>(d(e,t),function(e){const t=[[]];for(const r of e){const e=t.map(e=>[...e,r]);t.push(...e)}return t}(e)),arity:x(1)},"count-power-set":{evaluate:([e],t)=>(l(e,t,{integer:!0,nonNegative:!0}),e>=53?1/0:2**e),arity:x(1)}};function B(e){if(1===e)return[];const t=[];let r=2;for(;e>1;)e%r===0?(t.push(r),e/=r):r++;return t}const L={"prime-factors":{evaluate:([e],t)=>(l(e,t,{finite:!0,integer:!0,positive:!0}),B(e)),arity:x(1)},"distinct-prime-factors":{evaluate:([e],t)=>{l(e,t,{finite:!0,integer:!0,positive:!0});const r=B(e),n=new Set(r);return Array.from(n)},arity:x(1)},"count-prime-factors":{evaluate:([e],t)=>(l(e,t,{finite:!0,integer:!0,positive:!0}),B(e).length),arity:x(1)},"count-distinct-prime-factors":{evaluate:([e],t)=>{l(e,t,{finite:!0,integer:!0,positive:!0});const r=B(e);return new Set(r).size},arity:x(1)}};function O(e){return M(e).reduce((e,t)=>e+t,0)>e}const _={"abundant-seq":e=>{const t=[];let r=2;for(;t.length<e;)O(r)&&t.push(r),r+=1;return t},"abundant?":e=>O(e),"abundant-take-while":e=>{const t=[];for(let r=2;;r+=1)if(O(r)){if(!e(r,t.length))break;t.push(r)}return t}};function J(e,t,r=1e-10){if(e===t)return!0;const n=Math.abs(e-t);if(0===e||0===t||n<r)return n<r;return n/(Math.abs(e)+Math.abs(t))<r}const X={"arithmetic-seq":{evaluate:([e,t,r],n)=>(l(e,n,{finite:!0}),l(t,n,{finite:!0}),l(r,n,{integer:!0,positive:!0}),Array.from({length:r},(r,n)=>e+n*t)),arity:x(3)},"arithmetic-take-while":{evaluate:([e,t,r],n,o,{executeFunction:i})=>{l(e,n,{finite:!0}),l(t,n,{finite:!0}),w(r,n);const a=[];for(let s=0;;s+=1){const m=e+s*t;if(!i(r,[m,s],o,n))break;a[s]=m}return a},arity:x(3)},"arithmetic-nth":{evaluate:([e,t,r],n)=>(l(e,n,{finite:!0}),l(t,n,{finite:!0}),l(r,n,{integer:!0,positive:!0}),e+(r-1)*t),arity:x(3)},"arithmetic?":{evaluate:([e,t,r],n)=>(l(r,n),l(e,n,{finite:!0}),l(t,n,{finite:!0}),function(e,t,r){if(0===t)return J(r,e);const n=(r-e)/t;if(n<0)return!1;const o=Math.round(n),i=e+t*o;return J(n,o)&&J(i,r)}(e,t,r)),arity:x(3)}};function U(e){const t=[1];for(let r=1;r<e;r+=1){let e=0;for(let n=0;n<r;n+=1)e+=N(r+1,n)*t[n];t[r]=r>1&&r%2==1?0:-e/(r+1)}return t}const Z={"bernoulli-seq":{evaluate:([e],t)=>(l(e,t,{integer:!0,positive:!0}),U(e)),arity:x(1)},"bernoulli-nth":{evaluate:([e],t)=>{l(e,t,{integer:!0,positive:!0});return U(e)[e-1]},arity:x(1)},"bernoulli-take-while":{evaluate:([e],t,r,{executeFunction:n})=>{w(e,t);return function(e){const t=[1];let r=1;for(;;){const n=t.length+100;for(;r<n;r++){let n=0;for(let e=0;e<r;e++)n+=N(r+1,e)*t[e];const o=r>1&&r%2==1?0:-n/(r+1);if(!e(o,r))return t;t.push(o)}}}((t,o)=>!!n(e,[t,o],r))},arity:x(1)}};function H(e){if(e<=1)return!1;if(e<=3)return!0;if(e%2==0||e%3==0)return!1;for(let t=5;t*t<=e;t+=6)if(e%t===0||e%(t+2)===0)return!1;return!0}const K={"prime-seq":e=>{const t=[];let r=2;for(;t.length<e;)H(r)&&t.push(r),r+=1;return t},"prime?":e=>H(e),"prime-take-while":e=>{const t=[];for(let r=2;;r+=1)if(H(r)){if(!e(r,t.length))break;t.push(r)}return t}};function Q(e){return!(e<=1)&&!H(e)}const V={"composite-seq":e=>{const t=[];let r=2;for(;t.length<e;)Q(r)&&t.push(r),r+=1;return t},"composite?":e=>Q(e),"composite-take-while":e=>{const t=[];for(let r=4;;r+=1)if(Q(r)){if(!e(r,t.length))break;t.push(r)}return t}};function Y(e){return M(e).reduce((e,t)=>e+t,0)<e}const ee={"deficient-seq":e=>{const t=[];let r=1;for(;t.length<e;)Y(r)&&t.push(r),r+=1;return t},"deficient?":e=>Y(e),"deficient-take-while":e=>{const t=[];for(let r=1;;r+=1)if(Y(r)){if(!e(r,t.length))break;t.push(r)}return t}};const te={"geometric-seq":{evaluate:([e,t,r],n)=>(l(e,n,{finite:!0}),l(t,n,{finite:!0}),l(r,n,{integer:!0,positive:!0}),Array.from({length:r},(r,n)=>e*t**n)),arity:x(3)},"geometric-take-while":{evaluate:([e,t,r],n,o,{executeFunction:i})=>{l(e,n,{finite:!0}),l(t,n,{finite:!0}),w(r,n);const a=[];for(let s=0;;s+=1){const m=e*t**s;if(!i(r,[m,s],o,n))break;a[s]=m}return a},arity:x(3)},"geometric-nth":{evaluate:([e,t,r],n)=>(l(e,n,{finite:!0}),l(t,n,{finite:!0}),l(r,n,{integer:!0,positive:!0}),e*t**(r-1)),arity:x(3)},"geometric?":{evaluate:([e,t,r],n)=>(l(r,n),l(e,n,{finite:!0}),l(t,n,{finite:!0}),function(e,t,r){if(J(e,0))return J(r,0);if(J(t,1))return J(r,e);if(J(t,0))return J(r,0)||J(r,e);if(J(r,e))return!0;if(J(t,-1))return J(r,e)||J(r,-e);if(t<0){const n=Math.log(Math.abs(r/e))/Math.log(Math.abs(t)),o=Math.round(n);if(!J(o,n)||o<0)return!1;const i=o%2==0?Math.sign(e):Math.sign(e)*Math.sign(t);return Math.sign(r)===i}if(t>1&&r<e||t<1&&r>e)return!1;const n=Math.log(r/e)/Math.log(t),o=Math.round(n);return!(!J(o,n)||o<0)&&J(e*t**o,r)}(e,t,r)),arity:x(3)}};const re={"golomb-seq":e=>function(e){const t=[0,1];for(let r=2;r<=e;r+=1)t.push(1+t[r-t[t[r-1]]]);return t.slice(1)}(e),"golomb?":()=>!0,"golomb-take-while":e=>function(e){if(!e(1,0))return[];const t=[0,1];for(let r=2;;r++){const n=1+t[r-t[t[r-1]]];if(!e(n,r-1))break;t.push(n)}return t.slice(1)}(e)};function ne(e){let t=0;for(;e>0;){const r=e%10;t+=r*r,e=Math.floor(e/10)}return t}const oe={"happy-seq":e=>{const t=[];for(let r=1;t.length<e;r++){let e=r;const n=new Set;for(;1!==e&&!n.has(e);)n.add(e),e=String(e).split("").reduce((e,t)=>e+Number(t)**2,0);1===e&&t.push(r)}return t},"happy?":e=>function(e){if(e<=0)return!1;const t=new Set;for(;1!==e&&!t.has(e);)t.add(e),e=ne(e);return 1===e}(e),"happy-take-while":e=>{const t=[];for(let r=1;;r++){let n=r;const o=new Set;for(;1!==n&&!o.has(n);)o.add(n),n=String(n).split("").reduce((e,t)=>e+Number(t)**2,0);if(1===n){if(!e(r,t.length))break;t.push(r)}}return t}},ie={"juggler-seq":e=>{let t=e;const r=[t];for(;t>1;)t=t%2==0?Math.floor(Math.sqrt(t)):Math.floor(t**1.5),r.push(t);return r},noNth:!0};function ae(e){let t="",r=1;for(let n=0;n<e.length;n++)n+1<e.length&&e[n]===e[n+1]?r++:(t+=r.toString()+e[n],r=1);return t}const se={string:!0,"look-and-say-seq":e=>{const t=["1"];for(let r=1;r<e;r+=1){const e=t[r-1].replace(/(\d)\1*/g,e=>`${e.length}${e[0]}`);t[r]=e}return t},"look-and-say-take-while":e=>{if(!e("1",0))return[];const t=["1"];for(let r=1;;r+=1){const n=t[r-1].replace(/(\d)\1*/g,e=>`${e.length}${e[0]}`);if(!e(n,r))break;t[r]=n}return t},"look-and-say?":e=>function(e){let t="1";if(t===e)return!0;for(;;){if(t=ae(t),t===e)return!0;if(t.length>e.length)return!1}}(e)};function me(e){const t=[];for(let e=1;e<=2e3;e++)t.push(e);let r=[1];for(let e=1;e<t.length;e++)t[e]%2!=0&&r.push(t[e]);const n=[1];let o=1;if(!e(1,0))return[];let i=1;for(;i<r.length;){const t=r[i];if(!e(t,o))break;n.push(t),o++;const a=t,s=[];for(let e=0;e<r.length;e++)(e+1)%a!==0&&s.push(r[e]);if(r=s,i++,i>=r.length-5){let e=r[r.length-1]+2;for(;r.length<i+1e3;)r.push(e),e+=2}}return n}const ue={"lucky-seq":e=>function(e){const t=[];let r=1;const n=e*(e<100?20:30);for(;t.length<n;)t.push(r),r+=2;let o=1;for(;o<t.length&&o<e;){const e=t[o];let r=0;for(let n=0;n<t.length;n++)(n+1)%e!==0&&(t[r++]=t[n]);t.length=r,o<t.length&&o++}return t.slice(0,e)}(e),"lucky?":e=>me(t=>t<=e).includes(e),"lucky-take-while":e=>me(e)};const he={"padovan-seq":e=>{const t=[1,1,1];for(let r=3;r<e;r+=1)t[r]=t[r-2]+t[r-3];return t.slice(0,e)},"padovan?":e=>function(e){if(!Number.isInteger(e)||e<=0)return!1;if(1===e)return!0;const t=[1,1,1,2,2,3,4,5,7,9,12,16,21,28,37,49,65,86,114,151,200,265,351,465,616,816,1081,1432,1897,2513,3329,4410,5842,7739,10252,13581,17991,23833,31572,41824,55405,73396,97229];if(t.includes(e))return!0;if(e>t[t.length-1]&&e<=Number.MAX_SAFE_INTEGER){let r,n=t[t.length-3],o=t[t.length-2],i=t[t.length-1];for(;i<e;){if(r=n+o,n=o,o=i,i=r,i===e)return!0;if(!Number.isSafeInteger(i))return!1}}return!1}(e),"padovan-take-while":e=>{const t=[];if(!e(1,0))return t;if(t.push(1),!e(1,1))return t;if(t.push(1),!e(1,2))return t;t.push(1);let r=1,n=1,o=1;for(let i=4;;i+=1){const a=r+n;if(r=n,n=o,o=a,!e(o,i))break;t.push(o)}return t}},ce={"perfect-cube-seq":e=>{const t=[];for(let r=1;r<=e;r++)t.push(r**3);return t},"perfect-cube?":e=>e>0&&Number.isInteger(Math.cbrt(e)),"perfect-cube-take-while":e=>{const t=[];for(let r=1;;r++){const n=r**3;if(!e(n,r))break;t.push(n)}return t}};function le(e){if(e<2)return 1===e?[1,2]:null;const t=Math.floor(Math.log2(e))+1;for(let r=2;r<=t;r++){const t=e**(1/r),n=Math.round(t);if(J(n**r,e))return[n,r]}return null}const pe={"perfect-power-seq":e=>{const t=[];for(let r=1;t.length<e;r++)le(r)&&t.push(r);return t},"perfect-power?":e=>null!==le(e),"perfect-power-take-while":e=>{const t=[];for(let r=1;;r++)if(le(r)){if(!e(r,t.length))break;t.push(r)}return t}},ye={"perfect-square-seq":e=>{const t=[];for(let r=1;r<=e;r++)t.push(r**2);return t},"perfect-square?":e=>e>0&&Number.isInteger(Math.sqrt(e)),"perfect-square-take-while":e=>{const t=[];for(let r=1;;r++){const n=r**2;if(!e(n,r))break;t.push(n)}return t}},be={"polygonal-seq":{evaluate:([e,t],r)=>{l(e,r,{integer:!0,gte:3}),l(t,r,{integer:!0,positive:!0});const n=[];for(let r=1;r<=t;r+=1)n[r-1]=(r*r*(e-2)-r*(e-4))/2;return n},arity:x(2)},"polygonal-take-while":{evaluate:([e,t],r,n,{executeFunction:o})=>{l(e,r,{integer:!0,gte:3}),w(t,r);const i=[];for(let a=1;;a+=1){if(!o(t,[(a*a*(e-2)-a*(e-4))/2,a],n,r))break;i[a-1]=(a*a*(e-2)-a*(e-4))/2}return i},arity:x(2)},"polygonal-nth":{evaluate:([e,t],r)=>(l(e,r,{integer:!0,gte:3}),l(t,r,{integer:!0,positive:!0}),(t*t*(e-2)-t*(e-4))/2),arity:x(2)},"polygonal?":{evaluate:([e,t],r)=>{if(l(t,r,{integer:!0}),l(e,r,{integer:!0,gte:3}),t<=0)return!1;const n=e-2,o=e-4,i=8*n*t+o*o,a=Math.sqrt(i);if(!Number.isInteger(a))return!1;const s=a+o;if(s%(2*n)!=0)return!1;const m=s/(2*n);return Number.isInteger(m)&&m>0},arity:x(2)}};const ge={"recaman-seq":e=>function(e){if(1===e)return[0];const t=[0],r=new Set([0]);for(let n=1;n<e;n++){let e=t[n-1]-n;(e<=0||r.has(e))&&(e=t[n-1]+n),t.push(e),r.add(e)}return t}(e),"recaman-take-while":e=>{if(!e(0,0))return[];const t=[0],r=new Set([0]);for(let n=1;;n++){let o=t[n-1]-n;if((o<=0||r.has(o))&&(o=t[n-1]+n),!e(o,n))break;t.push(o),r.add(o)}return t},"recaman?":()=>!0},fe={"thue-morse-seq":e=>{const t=[];for(let r=0;r<e;r+=1)t[r]=de(r)%2;return t},"thue-morse-take-while":e=>{const t=[];for(let r=0;;r+=1){const n=de(r)%2;if(!e(n,r))break;t[r]=n}return t},"thue-morse?":e=>1===e||0===e};function de(e){let t=0;for(;e;)t+=1&e,e>>=1;return t}const qe={};function ve(e){for(const[t,r]of Object.entries(e)){if(qe[t])throw new Error(`Duplicate normal expression key found: ${t}`);qe[t]=r}}function ke(e,t){return{[`${e}-seq`]:xe(e=>t.slice(0,e),t.length),[`${e}-take-while`]:Ae(e=>{let r=0;for(r=0;!(r>=t.length)&&e(t[r],r);r+=1);return t.slice(0,r)},t.length),[`${e}-nth`]:Ne(()=>t,t.length),[`${e}?`]:Te(e=>t.includes(e))}}function we(e){for(const[t,r]of Object.entries(e)){if(qe[t])throw new Error(`Duplicate normal expression key found: ${t}`);t.endsWith("seq")?(qe[t]=xe(r,e.maxLength),e.noNth||(qe[t.replace(/seq$/,"nth")]=Ne(r,e.maxLength))):t.endsWith("take-while")?qe[t]=Ae(r,e.maxLength):t.endsWith("?")&&(e.string?qe[t]=Ge(r):qe[t]=Te(r))}}function xe(e,r){return{evaluate:(n,o)=>{const i=n[0]??r;l(i,o,{integer:!0,positive:!0,lte:r});const a=e(i,o);if("number"==typeof a[0]&&a.some(e=>e>Number.MAX_SAFE_INTEGER))throw new t("Result exceeds maximum safe integer",o);return a},arity:"number"==typeof r?{max:1}:x(1)}}function Ae(e,r){return{evaluate:(r,n,o,{executeFunction:i})=>{const a=r[0];w(a,n);const s=e((e,t)=>!!i(a,[e,t],o),n);if("number"==typeof s[0]&&s.some(e=>e>Number.MAX_SAFE_INTEGER))throw new t("Result exceeds maximum safe integer",n);return s},arity:"number"==typeof r?{max:1}:x(1)}}function Ne(e,r){return{evaluate:(n,o)=>{const i=n[0];l(i,o,{integer:!0,positive:!0,lte:r});const a=e(i,o);if("number"==typeof a[0]&&a.some(e=>e>Number.MAX_SAFE_INTEGER))throw new t("Result exceeds maximum safe integer",o);return a[i-1]},arity:x(1)}}function Te(e){return{evaluate:(t,r)=>{const n=t[0];return l(n,r),e(n,r)},arity:x(1)}}function Ge(e){return{evaluate:(t,r)=>{const n=t[0];return function(e,t,r={}){if(!function(e,t={}){return!("string"!=typeof e||t.nonEmpty&&0===e.length||t.char&&1!==e.length)}(e,r))throw f(r.nonEmpty?"non empty string":r.char?"character":"string",e,t)}(n,r),e(n,r)},arity:x(1)}}function $e(e,t){for(;0!==t;){const r=t;t=e%t,e=r}return Math.abs(e)}function Ce(e,t){return Math.floor(e*t/$e(e,t))}function We(e){if(1===e)return 1;const t=B(e);return new Set(t).size!==t.length?0:t.length%2==0?1:-1}function Me(e,t){if(0===t)return[e,1,0];const[r,n,o]=Me(t,e%t);return[r,o,n-Math.floor(e/t)*o]}function Se(e,t){const[r,n]=Me(e,t);if(1!==r)throw new Error(`Modular inverse does not exist (gcd(${e}, ${t}) = ${r})`);return(n%t+t)%t}we(_),we({"collatz-seq":e=>{let t=e;const r=[t];for(;1!==t;)t%2==0?t/=2:t=3*t+1,r.push(t);return r},noNth:!0}),we(V),we(ee),we(re),we(oe),we(ie),we(se),we(ue),we(he),we(ye),we(ce),we(pe),we(K),we(ge),we(fe),ve(ke("tribonacci",[0,1,1,2,4,7,13,24,44,81,149,274,504,927,1705,3136,5768,10609,19513,35890,66012,121415,223317,410744,755476,1389537,2555757,4700770,8646064,15902591,29249425,53798080,98950096,181997601,334745777,615693474,1132436852,2082876103,3831006429,7046319384,12960201916,23837527729,43844049029,80641778674,148323355432,272809183135,501774317241,922906855808,1697490356184,3122171529233,5742568741225,0x99b36012952,19426970897100,35731770264967,65720971788709,0x6df08059d9f8,0xca35cf00a924,408933139743937,752145307699165,0x4ea34736b35c2,0x90a3317d5c260,4680045560037375,8607945812375585])),ve(ke("catalan",[1,2,5,14,42,132,429,1430,4862,16796,58786,208012,742900,2674440,9694845,35357670,129644790,477638700,1767263190,6564120420,24466267020,91482563640,343059613650,1289904147324,4861946401452,18367353072152,69533550916004,0xefe09af96cd8,0x38f88b34d6a68,0xd8db5c347b610])),ve(ke("factorial",E)),ve(ke("fibonacci",[0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368,75025,121393,196418,317811,514229,832040,1346269,2178309,3524578,5702887,9227465,14930352,24157817,39088169,63245986,102334155,165580141,267914296,433494437,701408733,1134903170,1836311903,2971215073,4807526976,7778742049,12586269025,20365011074,32951280099,53316291173,86267571272,139583862445,225851433717,365435296162,591286729879,956722026041,1548008755920,2504730781961,4052739537881,6557470319842,0x9a661ca20bb,0xf9d297a859d,27777890035288,44945570212853,72723460248141,0x6b04f4c2fe42,0xad2934c6d08f,308061521170129,498454011879264,806515533049393,0x4a2dce62b0d91,0x780626e057bc2,0xc233f54308953,5527939700884757,8944394323791464])),ve(ke("lucas",[2,1,3,4,7,11,18,29,47,76,123,199,322,521,843,1364,2207,3571,5778,9349,15127,24476,39603,64079,103682,167761,271443,439204,710647,1149851,1860498,3010349,4870847,7881196,12752043,20633239,33385282,54018521,87403803,141422324,228826127,370248451,599074578,969323029,1568397607,2537720636,4106118243,6643838879,10749957122,17393796001,28143753123,45537549124,73681302247,119218851371,192900153618,312119004989,505019158607,817138163596,1322157322203,2139295485799,3461452808002,5600748293801,9062201101803,0xd55fbe3dc94,23725150497407,38388099893011,62113250390418,0x5b67cb4878a5,0x93e5a9822a37,0xef4d74caa2dc,425730551631123,688846502588399,0x3f5b3b1643d02,0x66834447bacf1,0xa5de7f5dfe9f3,4721424167835364,7639424778862807])),ve(ke("mersenne",[3,7,31,127,2047,8191,131071,524287,2147483647])),ve(ke("partition",z)),ve(ke("pell",[1,2,5,12,29,70,169,408,985,2378,5741,13860,33461,80782,195025,470832,1136689,2744210,6625109,15994428,38613965,93222358,225058681,543339720,1311738121,3166815962,7645370045,18457556052,44560482149,107578520350,259717522849,627013566048,1513744654945,3654502875938,8822750406821,21300003689580,51422757785981,0x70e8e1937766,299713796309065,723573111879672,0x634c28af7f039,0xefb9b143d586a])),ve(ke("perfect",[6,28,496,8128,33550336,8589869056,137438691328])),ve(ke("sylvester",[2,6,42,1806,3263442,0x9afa8dc8416])),ve(ke("bell",[1,2,5,15,52,203,877,4140,21147,115975,678570,4213597,27644437,190899322,1382958545,10480142147,82864869804,682076806159,5832742205057,51724158235372,474869816156751,4506715738447323])),ve(X),ve(Z),ve(te),ve(be);const Ee={"coprime?":{evaluate:([e,t],r)=>(l(e,r,{integer:!0}),l(t,r,{integer:!0}),1===$e(e,t)),arity:x(2)},"divisible-by?":{evaluate:([e,t],r)=>(l(e,r,{integer:!0}),l(t,r,{integer:!0}),0!==t&&e%t===0),arity:x(2)},gcd:{evaluate:([e,t],r)=>(l(e,r),l(t,r),$e(e,t)),arity:x(2)},lcm:{evaluate:([e,t],r)=>(l(e,r),l(t,r),Ce(e,t)),arity:x(2)},multinomial:{evaluate:([...e],t)=>{g(e,t);return R(e.reduce((e,r)=>(l(r,t,{integer:!0,nonNegative:!0}),e+r),0))/e.reduce((e,t)=>e*R(t),1)},arity:{min:1}},"amicable?":{evaluate:([e,t],r)=>{l(e,r,{integer:!0,positive:!0}),l(t,r,{integer:!0,positive:!0});const n=M(e).reduce((e,t)=>e+t,0),o=M(t).reduce((e,t)=>e+t,0);return n===t&&o===e&&e!==t},arity:x(2)},"euler-totient":{evaluate:([e],t)=>{l(e,t,{integer:!0,positive:!0});let r=e;for(let t=2;t*t<=e;t+=1)if(e%t===0){for(;e%t===0;)e/=t;r-=r/t}return e>1&&(r-=r/e),r},arity:x(1)},mobius:{evaluate:([e],t)=>{if(l(e,t,{integer:!0,positive:!0}),1===e)return 1;const r=B(e);return new Set(r).size!==r.length?0:r.length%2==0?1:-1},arity:x(1)},mertens:{evaluate:([e],t)=>{if(l(e,t,{integer:!0,positive:!0}),1===e)return 1;let r=0;for(let t=1;t<=e;t++){r+=We(t)}return r},arity:x(1)},sigma:{evaluate:([e],t)=>(l(e,t,{integer:!0,positive:!0}),W(e).reduce((e,t)=>e+t,0)),arity:x(1)},"carmichael-lambda":{evaluate:([e],t)=>{if(l(e,t,{integer:!0,positive:!0}),1===e)return 1;const r=B(e),n=new Map;for(const e of r)n.set(e,(n.get(e)||0)+1);const o=[];for(const[e,t]of n.entries())2===e?1===t?o.push(1):2===t?o.push(2):o.push(2**(t-2)):o.push((e-1)*e**(t-1));return o.reduce((e,t)=>Ce(e,t),1)},arity:x(1)},"cartesian-product":{evaluate:(e,t)=>{e.forEach(e=>{d(e,t)});return e.reduce((e,t)=>{const r=[];return e.forEach(e=>{t.forEach(t=>{r.push([...e,t])})}),r},[[]])},arity:{min:1}},"perfect-power":{evaluate:([e],t)=>{l(e,t,{integer:!0,positive:!0});return le(e)||null},arity:x(1)},"mod-exp":{evaluate:([e,t,r],n)=>(l(e,n,{finite:!0}),l(t,n,{integer:!0,positive:!0}),l(r,n,{integer:!0,positive:!0}),function(e,t,r){if(1===r)return 0;let n=1;for(e%=r;t>0;)t%2==1&&(n=n*e%r),t>>=1,e=e*e%r;return n}(e,t,r)),arity:x(3)},"mod-inv":{evaluate:([e,r],n)=>{l(e,n,{integer:!0,positive:!0}),l(r,n,{integer:!0,positive:!0});try{return Se(e,r)}catch(e){throw new t(e,n)}},arity:x(2)},"extended-gcd":{evaluate:([e,t],r)=>(l(e,r,{integer:!0}),l(t,r,{integer:!0}),Me(e,t)),arity:x(2)},"chinese-remainder":{evaluate:([e,r],n)=>{if(g(e,n),g(r,n),e.length!==r.length)throw new t("Remainders and moduli must have the same length.",n);try{return function(e,t){for(let e=0;e<t.length;e++)for(let r=e+1;r<t.length;r++){const n=Me(t[e],t[r])[0];if(1!==n)throw new Error(`Moduli must be pairwise coprime, but gcd(${t[e]}, ${t[r]}) = ${n}`)}const r=t.reduce((e,t)=>e*t,1);let n=0;for(let o=0;o<e.length;o++){const i=e[o],a=t[o],s=r/a;n=(n+i*s*Se(s,a))%r}return n}(e,r)}catch(e){throw new t(e.message,n)}},arity:x(2)},"stirling-first":{evaluate:([e,t],r)=>{l(e,r,{integer:!0,positive:!0}),l(t,r,{integer:!0,positive:!0,lte:e});const n=Array.from({length:e+1},()=>Array(t+1).fill(0));n[0][0]=1;for(let r=1;r<=e;r++)for(let e=1;e<=Math.min(r,t);e++)n[r][e]=n[r-1][e-1]+(r-1)*n[r-1][e];return n[e][t]},arity:x(2)},"stirling-second":{evaluate:([e,t],r)=>{if(l(e,r,{integer:!0,positive:!0}),l(t,r,{integer:!0,positive:!0,lte:e}),1===t)return 1;if(t===e)return 1;const n=Array.from({length:e+1},()=>Array(t+1).fill(0));n[0][0]=1;for(let r=1;r<=e;r++)for(let e=1;e<=Math.min(r,t);e++)n[r][e]=e*n[r-1][e]+n[r-1][e-1];return n[e][t]},arity:x(2)}};function Re(e){for(const[t,r]of Object.entries(e)){if(Ee[t])throw new Error(`Duplicate normal expression key found: ${t}`);Ee[t]=r}}!function(e){for(const[t,r]of Object.entries(e)){if(Ee[t])throw new Error(`Duplicate normal expression key found: ${t}`);Ee[t]=r}}(qe),Re(I),Re(S),Re(G),Re(P),Re(j),Re(L),Re($),Re(F);for(const[e,t]of Object.entries(A))Ee[e]&&(Ee[e].docs=t);const Ie={name:"number-theory",functions:Ee};exports.numberTheoryModule=Ie;
|
|
1
|
+
"use strict";function e(e){if(!e.position||!e.code)return"";const t=e.position.column-1,r=e.code.length-t-1;return`${" ".repeat(Math.max(t,0))}^${" ".repeat(Math.max(r,0))}`}class t extends Error{sourceCodeInfo;shortMessage;constructor(r,n){const o=r instanceof Error?r.message:`${r}`;super(function(t,r){if(!r)return t;const n=`${r.position.line}:${r.position.column}`;return`${t}${r.filePath?`\n${r.filePath}:${n}`:`\nLocation ${n}`}\n${r.code}\n${e(r)}`}(o,n)),this.shortMessage=o,this.sourceCodeInfo=n,Object.setPrototypeOf(this,t.prototype),this.name="LitsError"}getCodeMarker(){return this.sourceCodeInfo&&e(this.sourceCodeInfo)}}const r={Number:1,String:2,NormalExpression:3,SpecialExpression:4,UserDefinedSymbol:5,NormalBuiltinSymbol:6,SpecialBuiltinSymbol:7,ReservedSymbol:8,Binding:9,Spread:10},n=new Set(Object.values(r));const o=new Set(["UserDefined","Partial","Comp","Constantly","Juxt","Complement","EveryPred","SomePred","Fnull","Builtin","SpecialBuiltin","NativeJsFunction","Module"]);const i="^^fn^^",a="^^re^^";function s(e){return null!==e&&"object"==typeof e&&(i in e&&"functionType"in e&&("string"==typeof(t=e.functionType)&&o.has(t)));var t}function m(e){return!(!Array.isArray(e)||e.length<2)&&("number"==typeof(t=e[0])&&n.has(t));var t}function u(e){return s(e)?`<function ${e.name||"λ"}>`:m(e)?`${t=e[0],Object.keys(r).find(e=>r[e]===t)}-node`:null===e?"null":"object"==typeof e&&e instanceof RegExp?`${e}`:"object"==typeof e&&e instanceof Error?e.toString():JSON.stringify(e);var t}function h(e,t){return e?.sourceCodeInfo??t}function c(e,t={}){return"number"==typeof e&&(!Number.isNaN(e)&&(!(t.integer&&!Number.isInteger(e))&&(!(t.finite&&!Number.isFinite(e))&&((!t.zero||0===e)&&((!t.nonZero||0!==e)&&(!(t.positive&&e<=0)&&(!(t.negative&&e>=0)&&(!(t.nonPositive&&e>0)&&(!(t.nonNegative&&e<0)&&(!("number"==typeof t.gt&&e<=t.gt)&&(!("number"==typeof t.gte&&e<t.gte)&&(!("number"==typeof t.lt&&e>=t.lt)&&!("number"==typeof t.lte&&e>t.lte)))))))))))))}function l(e,r,n={}){if(!c(e,n))throw new t(`Expected ${function(e){if(e.zero)return"zero";const t=function(e){return e.positive?"positive":e.negative?"negative":e.nonNegative?"non negative":e.nonPositive?"non positive":e.nonZero?"non zero":""}(e),r=e.integer?"integer":"number",n=e.finite?"finite":"",o=function(e){return"number"!=typeof e.gt&&"number"!=typeof e.gte||"number"!=typeof e.lt&&"number"!=typeof e.lte?"number"==typeof e.gt||"number"==typeof e.gte?"number"==typeof e.gt?`n > ${e.gt}`:`n >= ${e.gte}`:"number"==typeof e.lt||"number"==typeof e.lte?"number"==typeof e.lt?`n < ${e.lt}`:`n <= ${e.lte}`:"":`${"number"==typeof e.gt?`${e.gt} < n `:`${e.gte} <= n `}${"number"==typeof e.lt?`< ${e.lt}`:`<= ${e.lte}`}`}(e);return[t,n,r,o].filter(e=>!!e).join(" ")}(n)}, got ${u(e)}.`,h(e,r))}const p=new WeakSet,y=new WeakSet,b=new WeakSet;function g(e,r){if(!function(e){return!(!Array.isArray(e)||!y.has(e)&&(b.has(e)||(e.every(e=>c(e))?(p.add(e),y.add(e),0):(b.add(e),1))))}(e))throw new t(`Expected a vector, but got ${e}`,r)}function f(e,r,n){return new t(`Expected ${e}, got ${u(r)}.`,h(r,n))}function d(e,t){if(!Array.isArray(e))throw f("array",e,t)}function q(e){return null!==e&&"object"==typeof e&&!!e[i]}function v(e){return!(null===e||"object"!=typeof e||Array.isArray(e)||e instanceof RegExp||q(e)||(t=e,null!==t&&"object"==typeof t&&t[a]));var t}function k(e){return function(e){return Array.isArray(e)||"string"==typeof e}(e)||v(e)}function w(e,t){if(!function(e){return"number"==typeof e||!!k(e)||!!q(e)}(e))throw f("FunctionLike",e,t)}function x(e){return{min:e,max:e}}const A={"abundant-seq":{category:"number-theory",description:"Generates the abundant numbers up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { abundant-seq } = import("number-theory");\nabundant-seq(1)','let { abundant-seq } = import("number-theory");\nabundant-seq(5)'],seeAlso:["number-theory.abundant-nth","number-theory.abundant-take-while","number-theory.abundant?","number-theory.deficient-seq","number-theory.perfect-seq"]},"abundant-take-while":{category:"number-theory",description:"Generates the abundant numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { abundant-take-while } = import("number-theory");\nabundant-take-while(-> $ < 100)'],seeAlso:["number-theory.abundant-seq","number-theory.abundant-nth","number-theory.abundant?"]},"abundant-nth":{category:"number-theory",description:"Generates the nth term of the abundant numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the number in the sequence."}},variants:[{argumentNames:["n"]}],examples:['let { abundant-nth } = import("number-theory");\nabundant-nth(1)','let { abundant-nth } = import("number-theory");\nabundant-nth(5)'],seeAlso:["number-theory.abundant-seq","number-theory.abundant-take-while","number-theory.abundant?"]},"abundant?":{category:"number-theory",description:"Checks if a number is abundant.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { abundant? } = import("number-theory");\nabundant?(12)','let { abundant? } = import("number-theory");\nabundant?(15)'],seeAlso:["number-theory.abundant-seq","number-theory.abundant-nth","number-theory.deficient?","number-theory.perfect?","number-theory.sigma","number-theory.divisors","number-theory.abundant-take-while"]},"arithmetic-seq":{category:"number-theory",description:"Generates the arithmetic sequence for a given $start, $step, and $length.",returns:{type:"integer",array:!0},args:{start:{type:"number",description:"The starting term of the sequence."},step:{type:"number",description:"The common difference of the sequence."},length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["start","step","length"]}],examples:['let { arithmetic-seq } = import("number-theory");\narithmetic-seq(3, 2, 2)','let { arithmetic-seq } = import("number-theory");\narithmetic-seq(2, 3, 2)','let { arithmetic-seq } = import("number-theory");\narithmetic-seq(1, 2, 2)','let { arithmetic-seq } = import("number-theory");\narithmetic-seq(1, 1.5, 12)'],seeAlso:["number-theory.arithmetic-nth","number-theory.arithmetic-take-while","number-theory.arithmetic?","number-theory.geometric-seq"]},"arithmetic-take-while":{category:"number-theory",description:"Generates the arithmetic sequence while a condition is met.",returns:{type:"integer",array:!0},args:{start:{type:"number",description:"The starting term of the sequence."},step:{type:"number",description:"The common difference of the sequence."},takeWhile:{type:"function",description:"A function that takes a number and an index and returns a boolean."}},variants:[{argumentNames:["start","step","takeWhile"]}],examples:['let { arithmetic-take-while } = import("number-theory");\narithmetic-take-while(1, 0.25, -> $ < 3)'],seeAlso:["number-theory.arithmetic-seq","number-theory.arithmetic-nth","number-theory.arithmetic?"]},"arithmetic-nth":{category:"number-theory",description:"Generates the nth term of the arithmetic sequence.",returns:{type:"integer"},args:{start:{type:"number",description:"The starting term of the sequence."},step:{type:"number",description:"The common difference of the sequence."},n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["start","step","n"]}],examples:['let { arithmetic-nth } = import("number-theory");\narithmetic-nth(3, 2, 2)','let { arithmetic-nth } = import("number-theory");\narithmetic-nth(2, 3, 2)','let { arithmetic-nth } = import("number-theory");\narithmetic-nth(1, 2, 2)','let { arithmetic-nth } = import("number-theory");\narithmetic-nth(1, 1.5, 12)'],seeAlso:["number-theory.arithmetic-seq","number-theory.arithmetic-take-while","number-theory.arithmetic?"]},"arithmetic?":{category:"number-theory",description:"Checks if a number is part of the arithmetic sequence.",returns:{type:"boolean"},args:{start:{type:"number",description:"The starting term of the sequence."},step:{type:"number",description:"The common difference of the sequence."},n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["start","step","n"]}],examples:['let { arithmetic? } = import("number-theory");\narithmetic?(3, 2, 2)','let { arithmetic? } = import("number-theory");\narithmetic?(2, 3, 2)','let { arithmetic? } = import("number-theory");\narithmetic?(1, 2, 2)','let { arithmetic? } = import("number-theory");\narithmetic?(1, 1.5, 12)'],seeAlso:["number-theory.arithmetic-seq","number-theory.arithmetic-nth","number-theory.geometric?","number-theory.arithmetic-take-while"]},"bell-seq":{category:"number-theory",description:"Generates the Bell sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 22 (the maximum length of the pre-calculated bell numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { bell-seq } = import("number-theory");\nbell-seq(5)','let { bell-seq } = import("number-theory");\nbell-seq(10)','let { bell-seq } = import("number-theory");\nbell-seq()'],seeAlso:["number-theory.bell-nth","number-theory.bell-take-while","number-theory.bell?","number-theory.catalan-seq","number-theory.stirling-second","number-theory.stirling-first"]},"bell-take-while":{category:"number-theory",description:"Generates the Bell sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { bell-take-while } = import("number-theory");\nbell-take-while(-> $ < 1000)'],seeAlso:["number-theory.bell-seq","number-theory.bell-nth","number-theory.bell?"]},"bell-nth":{category:"number-theory",description:"Generates the nth term of the Bell sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { bell-nth } = import("number-theory");\nbell-nth(5)','let { bell-nth } = import("number-theory");\nbell-nth(10)'],seeAlso:["number-theory.bell-seq","number-theory.bell-take-while","number-theory.bell?"]},"bell?":{category:"number-theory",description:"Checks if a number is in the Bell sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { bell? } = import("number-theory");\nbell?(1)','let { bell? } = import("number-theory");\nbell?(27644437)','let { bell? } = import("number-theory");\nbell?(27644436)'],seeAlso:["number-theory.bell-seq","number-theory.bell-nth","number-theory.catalan?","number-theory.bell-take-while"]},"bernoulli-seq":{category:"number-theory",description:"Generates the Bernoulli sequence up to a specified length.",returns:{type:"number",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { bernoulli-seq } = import("number-theory");\nbernoulli-seq(5)','let { bernoulli-seq } = import("number-theory");\nbernoulli-seq(10)'],seeAlso:["number-theory.bernoulli-nth","number-theory.bernoulli-take-while"]},"bernoulli-take-while":{category:"number-theory",description:"Generates the Bernoulli sequence while a condition is met.",returns:{type:"number",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { bernoulli-take-while } = import("number-theory");\nbernoulli-take-while(-> abs($) < 100)'],seeAlso:["number-theory.bernoulli-seq","number-theory.bernoulli-nth"]},"bernoulli-nth":{category:"number-theory",description:"Generates the nth term of the Bernoulli sequence.",returns:{type:"number"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { bernoulli-nth } = import("number-theory");\nbernoulli-nth(5)','let { bernoulli-nth } = import("number-theory");\nbernoulli-nth(10)','let { bernoulli-nth } = import("number-theory");\nbernoulli-nth(23)'],seeAlso:["number-theory.bernoulli-seq","number-theory.bernoulli-take-while"]},"catalan-seq":{category:"number-theory",description:"Generates the Catalan sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 30 (the maximum length of the pre-calculated catalan numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { catalan-seq } = import("number-theory");\ncatalan-seq(5)','let { catalan-seq } = import("number-theory");\ncatalan-seq(10)','let { catalan-seq } = import("number-theory");\ncatalan-seq()'],seeAlso:["number-theory.catalan-nth","number-theory.catalan-take-while","number-theory.catalan?","number-theory.bell-seq"]},"catalan-take-while":{category:"number-theory",description:"Generates the Catalan sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { catalan-take-while } = import("number-theory");\ncatalan-take-while(-> $ < 1000)'],seeAlso:["number-theory.catalan-seq","number-theory.catalan-nth","number-theory.catalan?"]},"catalan-nth":{category:"number-theory",description:"Generates the nth term of the Catalan sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { catalan-nth } = import("number-theory");\ncatalan-nth(5)','let { catalan-nth } = import("number-theory");\ncatalan-nth(10)'],seeAlso:["number-theory.catalan-seq","number-theory.catalan-take-while","number-theory.catalan?"]},"catalan?":{category:"number-theory",description:"Determines if a number is in the Catalan sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { catalan? } = import("number-theory");\ncatalan?(5)','let { catalan? } = import("number-theory");\ncatalan?(10)'],seeAlso:["number-theory.catalan-seq","number-theory.catalan-nth","number-theory.bell?","number-theory.catalan-take-while"]},"collatz-seq":{category:"number-theory",description:"Generates the collatz sequence starting from a given integer.",returns:{type:"integer",array:!0},args:{start:{type:"integer",description:"The starting integer for the collatz sequence."}},variants:[{argumentNames:["start"]}],examples:['let { collatz-seq } = import("number-theory");\ncollatz-seq(3)','let { collatz-seq } = import("number-theory");\ncollatz-seq(11)'],seeAlso:["number-theory.juggler-seq"]},"composite-seq":{category:"number-theory",description:"Generates the composite sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { composite-seq } = import("number-theory");\ncomposite-seq(1)','let { composite-seq } = import("number-theory");\ncomposite-seq(2)','let { composite-seq } = import("number-theory");\ncomposite-seq(10)'],seeAlso:["number-theory.composite-nth","number-theory.composite-take-while","number-theory.composite?","number-theory.prime-seq"]},"composite-take-while":{category:"number-theory",description:"Generates the composite sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { composite-take-while } = import("number-theory");\ncomposite-take-while(-> $ < 50)'],seeAlso:["number-theory.composite-seq","number-theory.composite-nth","number-theory.composite?"]},"composite-nth":{category:"number-theory",description:"Generates the nth term of the composite sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the composite number to retrieve."}},variants:[{argumentNames:["n"]}],examples:['let { composite-nth } = import("number-theory");\ncomposite-nth(1)','let { composite-nth } = import("number-theory");\ncomposite-nth(2)','let { composite-nth } = import("number-theory");\ncomposite-nth(10)'],seeAlso:["number-theory.composite-seq","number-theory.composite-take-while","number-theory.composite?"]},"composite?":{category:"number-theory",description:"Determines if a number is composite.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { composite? } = import("number-theory");\ncomposite?(4)','let { composite? } = import("number-theory");\ncomposite?(5)','let { composite? } = import("number-theory");\ncomposite?(11)'],seeAlso:["number-theory.composite-seq","number-theory.composite-nth","number-theory.prime?","number-theory.prime-factors","number-theory.composite-take-while"]},"deficient-seq":{category:"number-theory",description:"Generates the deficient numbers up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { deficient-seq } = import("number-theory");\ndeficient-seq(1)','let { deficient-seq } = import("number-theory");\ndeficient-seq(5)'],seeAlso:["number-theory.deficient-nth","number-theory.deficient-take-while","number-theory.deficient?","number-theory.abundant-seq","number-theory.perfect-seq"]},"deficient-take-while":{category:"number-theory",description:"Generates the deficient numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { deficient-take-while } = import("number-theory");\ndeficient-take-while(-> $ < 100)'],seeAlso:["number-theory.deficient-seq","number-theory.deficient-nth","number-theory.deficient?"]},"deficient-nth":{category:"number-theory",description:"Generates the nth term of the deficient numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the number in the sequence."}},variants:[{argumentNames:["n"]}],examples:['let { deficient-nth } = import("number-theory");\ndeficient-nth(5)','let { deficient-nth } = import("number-theory");\ndeficient-nth(12)'],seeAlso:["number-theory.deficient-seq","number-theory.deficient-take-while","number-theory.deficient?"]},"deficient?":{category:"number-theory",description:"Checks if a number is deficient.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { deficient? } = import("number-theory");\ndeficient?(12)','let { deficient? } = import("number-theory");\ndeficient?(15)'],seeAlso:["number-theory.deficient-seq","number-theory.deficient-nth","number-theory.abundant?","number-theory.perfect?","number-theory.sigma","number-theory.divisors","number-theory.deficient-take-while"]},"factorial-seq":{category:"number-theory",description:"Generates the factorial sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 19 (the maximum length of the pre-calculated factorial numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { factorial-seq } = import("number-theory");\nfactorial-seq(1)','let { factorial-seq } = import("number-theory");\nfactorial-seq(2)','let { factorial-seq } = import("number-theory");\nfactorial-seq(3)','let { factorial-seq } = import("number-theory");\nfactorial-seq(4)','let { factorial-seq } = import("number-theory");\nfactorial-seq(5)','let { factorial-seq } = import("number-theory");\nfactorial-seq(10)'],seeAlso:["number-theory.factorial-nth","number-theory.factorial-take-while","number-theory.factorial?","number-theory.factorial"]},"factorial-take-while":{category:"number-theory",description:"Generates the factorial sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { factorial-take-while } = import("number-theory");\nfactorial-take-while(-> $ < 1000)'],seeAlso:["number-theory.factorial-seq","number-theory.factorial-nth","number-theory.factorial?"]},"factorial-nth":{category:"number-theory",description:"Generates the nth term of the factorial sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { factorial-nth } = import("number-theory");\nfactorial-nth(1)','let { factorial-nth } = import("number-theory");\nfactorial-nth(2)','let { factorial-nth } = import("number-theory");\nfactorial-nth(3)','let { factorial-nth } = import("number-theory");\nfactorial-nth(4)','let { factorial-nth } = import("number-theory");\nfactorial-nth(5)','let { factorial-nth } = import("number-theory");\nfactorial-nth(10)'],seeAlso:["number-theory.factorial-seq","number-theory.factorial-take-while","number-theory.factorial?","number-theory.factorial"]},"factorial?":{category:"number-theory",description:"Checks if a number is in the factorial sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { factorial? } = import("number-theory");\nfactorial?(1)','let { factorial? } = import("number-theory");\nfactorial?(2)','let { factorial? } = import("number-theory");\nfactorial?(3)','let { factorial? } = import("number-theory");\nfactorial?(4)','let { factorial? } = import("number-theory");\nfactorial?(5)','let { factorial? } = import("number-theory");\nfactorial?(6)','let { factorial? } = import("number-theory");\nfactorial?(7)','let { factorial? } = import("number-theory");\nfactorial?(8)','let { factorial? } = import("number-theory");\nfactorial?(9)','let { factorial? } = import("number-theory");\nfactorial?(3628800)'],seeAlso:["number-theory.factorial-seq","number-theory.factorial-nth","number-theory.factorial","number-theory.factorial-take-while"]},"fibonacci-seq":{category:"number-theory",description:"Generates the fibonacci sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 79 (the maximum length of the pre-calculated Fibonacci numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { fibonacci-seq } = import("number-theory");\nfibonacci-seq(1)','let { fibonacci-seq } = import("number-theory");\nfibonacci-seq(2)','let { fibonacci-seq } = import("number-theory");\nfibonacci-seq()'],seeAlso:["number-theory.fibonacci-nth","number-theory.fibonacci-take-while","number-theory.fibonacci?","number-theory.lucas-seq","number-theory.tribonacci-seq","number-theory.pell-seq","number-theory.padovan-seq"]},"fibonacci-take-while":{category:"number-theory",description:"Generates the fibonacci sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { fibonacci-take-while } = import("number-theory");\nfibonacci-take-while(-> $ < 100)'],seeAlso:["number-theory.fibonacci-seq","number-theory.fibonacci-nth","number-theory.fibonacci?"]},"fibonacci-nth":{category:"number-theory",description:"Generates the nth term of the fibonacci sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { fibonacci-nth } = import("number-theory");\nfibonacci-nth(5)','let { fibonacci-nth } = import("number-theory");\nfibonacci-nth(50)'],seeAlso:["number-theory.fibonacci-seq","number-theory.fibonacci-take-while","number-theory.fibonacci?"]},"fibonacci?":{category:"number-theory",description:"Determines if a number is in the fibonacci sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { fibonacci? } = import("number-theory");\nfibonacci?(0)','let { fibonacci? } = import("number-theory");\nfibonacci?(1)','let { fibonacci? } = import("number-theory");\nfibonacci?(2)','let { fibonacci? } = import("number-theory");\nfibonacci?(3)','let { fibonacci? } = import("number-theory");\nfibonacci?(4)','let { fibonacci? } = import("number-theory");\nfibonacci?(5)','let { fibonacci? } = import("number-theory");\nfibonacci?(6)','let { fibonacci? } = import("number-theory");\nfibonacci?(7)','let { fibonacci? } = import("number-theory");\nfibonacci?(8)','let { fibonacci? } = import("number-theory");\nfibonacci?(9)'],seeAlso:["number-theory.fibonacci-seq","number-theory.fibonacci-nth","number-theory.lucas?","number-theory.fibonacci-take-while","number-theory.tribonacci?","number-theory.padovan?","number-theory.pell?"]},"geometric-seq":{category:"number-theory",description:"Generates the geometric sequence for a given $start, $ratio, and $length.",returns:{type:"integer",array:!0},args:{start:{type:"number",description:"The starting term of the sequence."},ratio:{type:"number",description:"The common ratio of the sequence."},length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["start","ratio","length"]}],examples:['let { geometric-seq } = import("number-theory");\ngeometric-seq(3, 2, 2)','let { geometric-seq } = import("number-theory");\ngeometric-seq(2, 3, 2)','let { geometric-seq } = import("number-theory");\ngeometric-seq(1, 2, 2)','let { geometric-seq } = import("number-theory");\ngeometric-seq(1, 1.5, 12)'],seeAlso:["number-theory.geometric-nth","number-theory.geometric-take-while","number-theory.geometric?","number-theory.arithmetic-seq"]},"geometric-take-while":{category:"number-theory",description:"Generates the geometric sequence while a condition is met.",returns:{type:"integer",array:!0},args:{start:{type:"number",description:"The starting term of the sequence."},ratio:{type:"number",description:"The common ratio of the sequence."},takeWhile:{type:"function",description:"A function that takes a number and an index and returns a boolean."}},variants:[{argumentNames:["start","ratio","takeWhile"]}],examples:['let { geometric-take-while } = import("number-theory");\ngeometric-take-while(1, 1.5, -> $ < 10)'],seeAlso:["number-theory.geometric-seq","number-theory.geometric-nth","number-theory.geometric?"]},"geometric-nth":{category:"number-theory",description:"Generates the nth term of the geometric sequence.",returns:{type:"integer"},args:{start:{type:"number",description:"The starting term of the sequence."},ratio:{type:"number",description:"The common ratio of the sequence."},n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["start","ratio","n"]}],examples:['let { geometric-nth } = import("number-theory");\ngeometric-nth(3, 2, 2)','let { geometric-nth } = import("number-theory");\ngeometric-nth(2, 3, 2)','let { geometric-nth } = import("number-theory");\ngeometric-nth(1, 2, 2)','let { geometric-nth } = import("number-theory");\ngeometric-nth(1, 1.5, 4)'],seeAlso:["number-theory.geometric-seq","number-theory.geometric-take-while","number-theory.geometric?"]},"geometric?":{category:"number-theory",description:"Checks if a number is in the geometric sequence.",returns:{type:"boolean"},args:{start:{type:"number",description:"The starting term of the sequence."},ratio:{type:"number",description:"The common ratio of the sequence."},n:{type:"number",description:"The number to check."}},variants:[{argumentNames:["start","ratio","n"]}],examples:['let { geometric? } = import("number-theory");\ngeometric?(1, 2, 1)','let { geometric? } = import("number-theory");\ngeometric?(2, 3, 2)','let { geometric? } = import("number-theory");\ngeometric?(3, 2, 2)','let { geometric? } = import("number-theory");\ngeometric?(1, 1.5, 2.25)','let { geometric? } = import("number-theory");\ngeometric?(1, 1.5, -4)'],seeAlso:["number-theory.geometric-seq","number-theory.geometric-nth","number-theory.arithmetic?","number-theory.geometric-take-while"]},"golomb-seq":{category:"number-theory",description:"Generates the Golomb sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { golomb-seq } = import("number-theory");\ngolomb-seq(5)','let { golomb-seq } = import("number-theory");\ngolomb-seq(20)'],seeAlso:["number-theory.golomb-nth","number-theory.golomb-take-while","number-theory.golomb?","number-theory.recaman-seq"]},"golomb-take-while":{category:"number-theory",description:"Generates the Golomb sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { golomb-take-while } = import("number-theory");\ngolomb-take-while(-> $ <= 10)'],seeAlso:["number-theory.golomb-seq","number-theory.golomb-nth","number-theory.golomb?"]},"golomb-nth":{category:"number-theory",description:"Generates the nth term of the Golomb sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { golomb-nth } = import("number-theory");\ngolomb-nth(5)','let { golomb-nth } = import("number-theory");\ngolomb-nth(1000)'],seeAlso:["number-theory.golomb-seq","number-theory.golomb-take-while","number-theory.golomb?"]},"golomb?":{category:"number-theory",description:"Checks if a number is in the Golomb sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { golomb? } = import("number-theory");\ngolomb?(1)','let { golomb? } = import("number-theory");\ngolomb?(2)','let { golomb? } = import("number-theory");\ngolomb?(3345)','let { golomb? } = import("number-theory");\ngolomb?(67867864)'],seeAlso:["number-theory.golomb-seq","number-theory.golomb-nth","number-theory.golomb-take-while"]},"happy-seq":{category:"number-theory",description:"Generates the happy sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 20 (the maximum length of the pre-calculated happy numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { happy-seq } = import("number-theory");\nhappy-seq(1)','let { happy-seq } = import("number-theory");\nhappy-seq(2)','let { happy-seq } = import("number-theory");\nhappy-seq(20)'],seeAlso:["number-theory.happy-nth","number-theory.happy-take-while","number-theory.happy?","number-theory.lucky-seq"]},"happy-take-while":{category:"number-theory",description:"Generates the happy sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { happy-take-while } = import("number-theory");\nhappy-take-while(-> $ < 100)'],seeAlso:["number-theory.happy-seq","number-theory.happy-nth","number-theory.happy?"]},"happy-nth":{category:"number-theory",description:"Generates the nth term of the happy sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the happy number to return."}},variants:[{argumentNames:["n"]}],examples:['let { happy-nth } = import("number-theory");\nhappy-nth(1)','let { happy-nth } = import("number-theory");\nhappy-nth(2)','let { happy-nth } = import("number-theory");\nhappy-nth(20)'],seeAlso:["number-theory.happy-seq","number-theory.happy-take-while","number-theory.happy?"]},"happy?":{category:"number-theory",description:"Determines if a number is a happy number.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { happy? } = import("number-theory");\nhappy?(1)','let { happy? } = import("number-theory");\nhappy?(2)','let { happy? } = import("number-theory");\nhappy?(100)'],seeAlso:["number-theory.happy-seq","number-theory.happy-nth","number-theory.happy-take-while"]},"juggler-seq":{category:"number-theory",description:"Generates the Juggler sequence starting from a given integer.",returns:{type:"integer",array:!0},args:{start:{type:"integer",description:"The starting integer for the Juggler sequence."}},variants:[{argumentNames:["start"]}],examples:['let { juggler-seq } = import("number-theory");\njuggler-seq(3)','let { juggler-seq } = import("number-theory");\njuggler-seq(5)'],seeAlso:["number-theory.collatz-seq"]},"look-and-say-seq":{category:"number-theory",description:"Generates the Look-and-Say sequence up to a specified length.",returns:{type:"string",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { look-and-say-seq } = import("number-theory");\nlook-and-say-seq(5)'],seeAlso:["number-theory.look-and-say-nth","number-theory.look-and-say-take-while","number-theory.look-and-say?"]},"look-and-say-take-while":{category:"number-theory",description:"Generates the Look-and-Say sequence while a condition is met.",returns:{type:"string",array:!0},args:{takeWhile:{type:"function",description:"A function that takes a string and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { look-and-say-take-while } = import("number-theory");\nlook-and-say-take-while((term, index) -> count(term) < 10)','let { look-and-say-take-while } = import("number-theory");\nlook-and-say-take-while(-> $2 <= 10)'],seeAlso:["number-theory.look-and-say-seq","number-theory.look-and-say-nth","number-theory.look-and-say?"]},"look-and-say-nth":{category:"number-theory",description:"Generates the nth term of the Look-and-Say sequence.",returns:{type:"string"},args:{n:{type:"integer",description:"The index of the term in the sequence."}},variants:[{argumentNames:["n"]}],examples:['let { look-and-say-nth } = import("number-theory");\nlook-and-say-nth(5)'],seeAlso:["number-theory.look-and-say-seq","number-theory.look-and-say-take-while","number-theory.look-and-say?"]},"look-and-say?":{category:"number-theory",description:"Checks if a string is a valid Look-and-Say term.",returns:{type:"boolean"},args:{term:{type:"string",description:"The term to check."}},variants:[{argumentNames:["term"]}],examples:['let { look-and-say? } = import("number-theory");\nlook-and-say?("111221")','let { look-and-say? } = import("number-theory");\nlook-and-say?("123")'],seeAlso:["number-theory.look-and-say-seq","number-theory.look-and-say-nth","number-theory.look-and-say-take-while"]},"lucas-seq":{category:"number-theory",description:"Generates the lucas sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 77 (the maximum length of the pre-calculated Lucas numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { lucas-seq } = import("number-theory");\nlucas-seq(1)','let { lucas-seq } = import("number-theory");\nlucas-seq(2)','let { lucas-seq } = import("number-theory");\nlucas-seq()'],seeAlso:["number-theory.lucas-nth","number-theory.lucas-take-while","number-theory.lucas?","number-theory.fibonacci-seq"]},"lucas-take-while":{category:"number-theory",description:"Generates the lucas sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { lucas-take-while } = import("number-theory");\nlucas-take-while(-> $ < 100)'],seeAlso:["number-theory.lucas-seq","number-theory.lucas-nth","number-theory.lucas?"]},"lucas-nth":{category:"number-theory",description:"Generates the nth term of the lucas sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { lucas-nth } = import("number-theory");\nlucas-nth(1)','let { lucas-nth } = import("number-theory");\nlucas-nth(2)','let { lucas-nth } = import("number-theory");\nlucas-nth(10)'],seeAlso:["number-theory.lucas-seq","number-theory.lucas-take-while","number-theory.lucas?"]},"lucas?":{category:"number-theory",description:"Determines if a number is in the lucas sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { lucas? } = import("number-theory");\nlucas?(1)','let { lucas? } = import("number-theory");\nlucas?(2)','let { lucas? } = import("number-theory");\nlucas?(10)'],seeAlso:["number-theory.lucas-seq","number-theory.lucas-nth","number-theory.fibonacci?","number-theory.lucas-take-while"]},"lucky-seq":{category:"number-theory",description:"Generates the lucky sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { lucky-seq } = import("number-theory");\nlucky-seq(1)','let { lucky-seq } = import("number-theory");\nlucky-seq(2)','let { lucky-seq } = import("number-theory");\nlucky-seq(20)'],seeAlso:["number-theory.lucky-nth","number-theory.lucky-take-while","number-theory.lucky?","number-theory.happy-seq","number-theory.prime-seq"]},"lucky-take-while":{category:"number-theory",description:"Generates the lucky sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { lucky-take-while } = import("number-theory");\nlucky-take-while(-> $ < 100)'],seeAlso:["number-theory.lucky-seq","number-theory.lucky-nth","number-theory.lucky?"]},"lucky-nth":{category:"number-theory",description:"Generates the nth term of the lucky sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The position in the sequence."}},variants:[{argumentNames:["n"]}],examples:['let { lucky-nth } = import("number-theory");\nlucky-nth(1)','let { lucky-nth } = import("number-theory");\nlucky-nth(2)','let { lucky-nth } = import("number-theory");\nlucky-nth(20)'],seeAlso:["number-theory.lucky-seq","number-theory.lucky-take-while","number-theory.lucky?"]},"lucky?":{category:"number-theory",description:"Checks if a number is a lucky number.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { lucky? } = import("number-theory");\nlucky?(4)','let { lucky? } = import("number-theory");\nlucky?(7)','let { lucky? } = import("number-theory");\nlucky?(33)'],seeAlso:["number-theory.lucky-seq","number-theory.lucky-nth","number-theory.prime?","number-theory.lucky-take-while"]},"mersenne-seq":{category:"number-theory",description:"Generates the Mersenne sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 9 (the maximum length of the pre-calculated mersenne numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { mersenne-seq } = import("number-theory");\nmersenne-seq(1)','let { mersenne-seq } = import("number-theory");\nmersenne-seq(5)','let { mersenne-seq } = import("number-theory");\nmersenne-seq()'],seeAlso:["number-theory.mersenne-nth","number-theory.mersenne-take-while","number-theory.mersenne?","number-theory.prime-seq"]},"mersenne-take-while":{category:"number-theory",description:"Generates the Mersenne sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { mersenne-take-while } = import("number-theory");\nmersenne-take-while(-> $ < 1000)'],seeAlso:["number-theory.mersenne-seq","number-theory.mersenne-nth","number-theory.mersenne?"]},"mersenne-nth":{category:"number-theory",description:"Generates the nth term of the Mersenne sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { mersenne-nth } = import("number-theory");\nmersenne-nth(1)','let { mersenne-nth } = import("number-theory");\nmersenne-nth(5)'],seeAlso:["number-theory.mersenne-seq","number-theory.mersenne-take-while","number-theory.mersenne?"]},"mersenne?":{category:"number-theory",description:"Checks if a number is in the Mersenne sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { mersenne? } = import("number-theory");\nmersenne?(3)','let { mersenne? } = import("number-theory");\nmersenne?(4)','let { mersenne? } = import("number-theory");\nmersenne?(7)'],seeAlso:["number-theory.mersenne-seq","number-theory.mersenne-nth","number-theory.prime?","number-theory.mersenne-take-while"]},"padovan-seq":{category:"number-theory",description:"Generates the Padovan sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { padovan-seq } = import("number-theory");\npadovan-seq(5)','let { padovan-seq } = import("number-theory");\npadovan-seq(10)','let { padovan-seq } = import("number-theory");\npadovan-seq(20)'],seeAlso:["number-theory.padovan-nth","number-theory.padovan-take-while","number-theory.padovan?","number-theory.fibonacci-seq"]},"padovan-take-while":{category:"number-theory",description:"Generates the Padovan sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { padovan-take-while } = import("number-theory");\npadovan-take-while(-> $ < 1000)'],seeAlso:["number-theory.padovan-seq","number-theory.padovan-nth","number-theory.padovan?"]},"padovan-nth":{category:"number-theory",description:"Generates the nth term of the Padovan sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { padovan-nth } = import("number-theory");\npadovan-nth(5)','let { padovan-nth } = import("number-theory");\npadovan-nth(10)','let { padovan-nth } = import("number-theory");\npadovan-nth(20)'],seeAlso:["number-theory.padovan-seq","number-theory.padovan-take-while","number-theory.padovan?"]},"padovan?":{category:"number-theory",description:"Checks if a number is in the Padovan sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { padovan? } = import("number-theory");\npadovan?(1)','let { padovan? } = import("number-theory");\npadovan?(265)','let { padovan? } = import("number-theory");\npadovan?(6)'],seeAlso:["number-theory.padovan-seq","number-theory.padovan-nth","number-theory.fibonacci?","number-theory.padovan-take-while"]},"partition-seq":{category:"number-theory",description:"Generates the partition numbers up to a specified length. If no length is provided, it defaults to 299 (the maximum length of the pre-calculated partition numbers).",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { partition-seq } = import("number-theory");\npartition-seq(1)','let { partition-seq } = import("number-theory");\npartition-seq(10)','let { partition-seq } = import("number-theory");\npartition-seq()'],seeAlso:["number-theory.partition-nth","number-theory.partition-take-while","number-theory.partition?","number-theory.partitions","number-theory.count-partitions"]},"partition-take-while":{category:"number-theory",description:"Generates the partition numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { partition-take-while } = import("number-theory");\npartition-take-while(-> $ < 1000)'],seeAlso:["number-theory.partition-seq","number-theory.partition-nth","number-theory.partition?"]},"partition-nth":{category:"number-theory",description:"Generates the nth term of the partition numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the partition number to generate."}},variants:[{argumentNames:["n"]}],examples:['let { partition-nth } = import("number-theory");\npartition-nth(1)','let { partition-nth } = import("number-theory");\npartition-nth(5)'],seeAlso:["number-theory.partition-seq","number-theory.partition-take-while","number-theory.partition?"]},"partition?":{category:"number-theory",description:"Checks if a number is in the partition numbers.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { partition? } = import("number-theory");\npartition?(0)','let { partition? } = import("number-theory");\npartition?(1)','let { partition? } = import("number-theory");\npartition?(2)','let { partition? } = import("number-theory");\npartition?(3)','let { partition? } = import("number-theory");\npartition?(4)','let { partition? } = import("number-theory");\npartition?(5)'],seeAlso:["number-theory.partition-seq","number-theory.partition-nth","number-theory.partitions","number-theory.partition-take-while"]},"pell-seq":{category:"number-theory",description:"Generates the Pell sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 42 (the maximum length of the pre-calculated Pell numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { pell-seq } = import("number-theory");\npell-seq(5)','let { pell-seq } = import("number-theory");\npell-seq(10)','let { pell-seq } = import("number-theory");\npell-seq()'],seeAlso:["number-theory.pell-nth","number-theory.pell-take-while","number-theory.pell?","number-theory.fibonacci-seq"]},"pell-take-while":{category:"number-theory",description:"Generates the Pell sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { pell-take-while } = import("number-theory");\npell-take-while(-> $ < 1000)'],seeAlso:["number-theory.pell-seq","number-theory.pell-nth","number-theory.pell?"]},"pell-nth":{category:"number-theory",description:"Generates the nth term of the Pell sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { pell-nth } = import("number-theory");\npell-nth(5)','let { pell-nth } = import("number-theory");\npell-nth(10)','let { pell-nth } = import("number-theory");\npell-nth(20)'],seeAlso:["number-theory.pell-seq","number-theory.pell-take-while","number-theory.pell?"]},"pell?":{category:"number-theory",description:"Checks if a number is a Pell number.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { pell? } = import("number-theory");\npell?(1)','let { pell? } = import("number-theory");\npell?(470832)','let { pell? } = import("number-theory");\npell?(10)'],seeAlso:["number-theory.pell-seq","number-theory.pell-nth","number-theory.fibonacci?","number-theory.pell-take-while"]},"perfect-seq":{category:"number-theory",description:"Generates the perfect numbers up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If no length is provided, it defaults to 7 (the maximum length of the pre-calculated perfect numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { perfect-seq } = import("number-theory");\nperfect-seq(1)','let { perfect-seq } = import("number-theory");\nperfect-seq(5)','let { perfect-seq } = import("number-theory");\nperfect-seq()'],seeAlso:["number-theory.perfect-nth","number-theory.perfect-take-while","number-theory.perfect?","number-theory.abundant-seq","number-theory.deficient-seq","number-theory.amicable?"]},"perfect-take-while":{category:"number-theory",description:"Generates the perfect numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { perfect-take-while } = import("number-theory");\nperfect-take-while(-> $ < 1000)'],seeAlso:["number-theory.perfect-seq","number-theory.perfect-nth","number-theory.perfect?"]},"perfect-nth":{category:"number-theory",description:"Generates the nth term of the perfect numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the perfect number to generate."}},variants:[{argumentNames:["n"]}],examples:['let { perfect-nth } = import("number-theory");\nperfect-nth(1)','let { perfect-nth } = import("number-theory");\nperfect-nth(5)'],seeAlso:["number-theory.perfect-seq","number-theory.perfect-take-while","number-theory.perfect?"]},"perfect?":{category:"number-theory",description:"Checks if a number is in the perfect numbers.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { perfect? } = import("number-theory");\nperfect?(0)','let { perfect? } = import("number-theory");\nperfect?(1)','let { perfect? } = import("number-theory");\nperfect?(2)','let { perfect? } = import("number-theory");\nperfect?(3)','let { perfect? } = import("number-theory");\nperfect?(4)','let { perfect? } = import("number-theory");\nperfect?(5)','let { perfect? } = import("number-theory");\nperfect?(6)','let { perfect? } = import("number-theory");\nperfect?(7)','let { perfect? } = import("number-theory");\nperfect?(8)','let { perfect? } = import("number-theory");\nperfect?(9)'],seeAlso:["number-theory.perfect-seq","number-theory.perfect-nth","number-theory.abundant?","number-theory.deficient?","number-theory.sigma","number-theory.perfect-take-while","number-theory.amicable?","number-theory.proper-divisors"]},"perfect-square-seq":{category:"number-theory",description:"Generates the perfect square numbers up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { perfect-square-seq } = import("number-theory");\nperfect-square-seq(5)','let { perfect-square-seq } = import("number-theory");\nperfect-square-seq(20)'],seeAlso:["number-theory.perfect-square-nth","number-theory.perfect-square-take-while","number-theory.perfect-square?","number-theory.perfect-cube-seq","number-theory.perfect-power-seq","number-theory.polygonal-seq"]},"perfect-square-take-while":{category:"number-theory",description:"Generates the perfect square numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { perfect-square-take-while } = import("number-theory");\nperfect-square-take-while(-> $ <= 100)'],seeAlso:["number-theory.perfect-square-seq","number-theory.perfect-square-nth","number-theory.perfect-square?"]},"perfect-square-nth":{category:"number-theory",description:"Generates the nth term of the perfect square numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { perfect-square-nth } = import("number-theory");\nperfect-square-nth(1)','let { perfect-square-nth } = import("number-theory");\nperfect-square-nth(5)'],seeAlso:["number-theory.perfect-square-seq","number-theory.perfect-square-take-while","number-theory.perfect-square?"]},"perfect-square?":{category:"number-theory",description:"Checks if a number is a perfect square.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { perfect-square? } = import("number-theory");\nperfect-square?(16)','let { perfect-square? } = import("number-theory");\nperfect-square?(20)'],seeAlso:["number-theory.perfect-square-seq","number-theory.perfect-square-nth","number-theory.perfect-cube?","number-theory.perfect-power?","number-theory.perfect-square-take-while","number-theory.perfect-power","number-theory.polygonal?"]},"perfect-cube-seq":{category:"number-theory",description:"Generates the perfect cube numbers up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { perfect-cube-seq } = import("number-theory");\nperfect-cube-seq(5)','let { perfect-cube-seq } = import("number-theory");\nperfect-cube-seq(20)'],seeAlso:["number-theory.perfect-cube-nth","number-theory.perfect-cube-take-while","number-theory.perfect-cube?","number-theory.perfect-square-seq","number-theory.perfect-power-seq"]},"perfect-cube-take-while":{category:"number-theory",description:"Generates the perfect cube numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { perfect-cube-take-while } = import("number-theory");\nperfect-cube-take-while(-> $ <= 100)'],seeAlso:["number-theory.perfect-cube-seq","number-theory.perfect-cube-nth","number-theory.perfect-cube?"]},"perfect-cube-nth":{category:"number-theory",description:"Generates the nth term of the perfect cube numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { perfect-cube-nth } = import("number-theory");\nperfect-cube-nth(1)','let { perfect-cube-nth } = import("number-theory");\nperfect-cube-nth(5)'],seeAlso:["number-theory.perfect-cube-seq","number-theory.perfect-cube-take-while","number-theory.perfect-cube?"]},"perfect-cube?":{category:"number-theory",description:"Checks if a number is in the perfect cube numbers.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { perfect-cube? } = import("number-theory");\nperfect-cube?(7)','let { perfect-cube? } = import("number-theory");\nperfect-cube?(8)','let { perfect-cube? } = import("number-theory");\nperfect-cube?(9)'],seeAlso:["number-theory.perfect-cube-seq","number-theory.perfect-cube-nth","number-theory.perfect-square?","number-theory.perfect-power?","number-theory.perfect-cube-take-while","number-theory.perfect-power"]},"perfect-power-seq":{category:"number-theory",description:"Generates the perfect power numbers up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { perfect-power-seq } = import("number-theory");\nperfect-power-seq(5)','let { perfect-power-seq } = import("number-theory");\nperfect-power-seq(20)'],seeAlso:["number-theory.perfect-power-nth","number-theory.perfect-power-take-while","number-theory.perfect-power?","number-theory.perfect-power","number-theory.perfect-square-seq","number-theory.perfect-cube-seq"]},"perfect-power-take-while":{category:"number-theory",description:"Generates the perfect power numbers while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { perfect-power-take-while } = import("number-theory");\nperfect-power-take-while(-> $ <= 100)'],seeAlso:["number-theory.perfect-power-seq","number-theory.perfect-power-nth","number-theory.perfect-power?"]},"perfect-power-nth":{category:"number-theory",description:"Generates the nth term of the perfect power numbers.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { perfect-power-nth } = import("number-theory");\nperfect-power-nth(3)','let { perfect-power-nth } = import("number-theory");\nperfect-power-nth(15)'],seeAlso:["number-theory.perfect-power-seq","number-theory.perfect-power-take-while","number-theory.perfect-power?"]},"perfect-power?":{category:"number-theory",description:"Checks if a number is in the perfect power numbers.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { perfect-power? } = import("number-theory");\nperfect-power?(7)','let { perfect-power? } = import("number-theory");\nperfect-power?(8)','let { perfect-power? } = import("number-theory");\nperfect-power?(9)','let { perfect-power? } = import("number-theory");\nperfect-power?(10)'],seeAlso:["number-theory.perfect-power-seq","number-theory.perfect-power-nth","number-theory.perfect-power","number-theory.perfect-square?","number-theory.perfect-cube?","number-theory.perfect-power-take-while"]},"polygonal-seq":{category:"number-theory",description:"Generates the polygonal sequence for a given number of sides and length.",returns:{type:"integer",array:!0},args:{sides:{type:"integer",description:"The number of sides of the polygon."},length:{type:"integer",description:"The length of the sequence to generate."},a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["sides","length"]}],examples:['let { polygonal-seq } = import("number-theory");\npolygonal-seq(3, 2)','let { polygonal-seq } = import("number-theory");\npolygonal-seq(4, 2)','let { polygonal-seq } = import("number-theory");\npolygonal-seq(5, 3)','let { polygonal-seq } = import("number-theory");\npolygonal-seq(6, 5)','let { polygonal-seq } = import("number-theory");\npolygonal-seq(100, 10)'],seeAlso:["number-theory.polygonal-nth","number-theory.polygonal-take-while","number-theory.polygonal?","number-theory.perfect-square-seq"]},"polygonal-take-while":{category:"number-theory",description:"Generates the polygonal sequence while a condition is met.",returns:{type:"integer",array:!0},args:{sides:{type:"integer",description:"The number of sides of the polygon."},takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."},a:{type:"integer"},b:{type:"function"}},variants:[{argumentNames:["sides","takeWhile"]}],examples:['let { polygonal-take-while } = import("number-theory");\npolygonal-take-while(15, -> $ < 1000)'],seeAlso:["number-theory.polygonal-seq","number-theory.polygonal-nth","number-theory.polygonal?"]},"polygonal-nth":{category:"number-theory",description:"Generates the nth term of the polygonal sequence.",returns:{type:"integer"},args:{sides:{type:"integer",description:"The number of sides of the polygon."},n:{type:"integer",description:"The index of the term to generate."},a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["sides","n"]}],examples:['let { polygonal-nth } = import("number-theory");\npolygonal-nth(3, 9)','let { polygonal-nth } = import("number-theory");\npolygonal-nth(4, 5)','let { polygonal-nth } = import("number-theory");\npolygonal-nth(5, 5)'],seeAlso:["number-theory.polygonal-seq","number-theory.polygonal-take-while","number-theory.polygonal?"]},"polygonal?":{category:"number-theory",description:"Checks if a number is in the polygonal sequence.",returns:{type:"boolean"},args:{sides:{type:"integer",description:"The number of sides of the polygon."},n:{type:"integer",description:"The number to check."},a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["sides","n"]}],examples:['let { polygonal? } = import("number-theory");\npolygonal?(3, 10)','let { polygonal? } = import("number-theory");\npolygonal?(3, 9)','let { polygonal? } = import("number-theory");\npolygonal?(4, 10000)','let { polygonal? } = import("number-theory");\npolygonal?(4, 1000)','let { polygonal? } = import("number-theory");\npolygonal?(6, 45)'],seeAlso:["number-theory.polygonal-seq","number-theory.polygonal-nth","number-theory.perfect-square?","number-theory.polygonal-take-while"]},"prime-seq":{category:"number-theory",description:"Generates the prime sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { prime-seq } = import("number-theory");\nprime-seq(1)','let { prime-seq } = import("number-theory");\nprime-seq(2)','let { prime-seq } = import("number-theory");\nprime-seq(10)'],seeAlso:["number-theory.prime-nth","number-theory.prime-take-while","number-theory.prime?","number-theory.composite-seq","number-theory.mersenne-seq","number-theory.lucky-seq"]},"prime-take-while":{category:"number-theory",description:"Generates the prime sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { prime-take-while } = import("number-theory");\nprime-take-while(-> $ < 50)'],seeAlso:["number-theory.prime-seq","number-theory.prime-nth","number-theory.prime?"]},"prime-nth":{category:"number-theory",description:"Generates the nth term of the prime sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { prime-nth } = import("number-theory");\nprime-nth(1)','let { prime-nth } = import("number-theory");\nprime-nth(2)','let { prime-nth } = import("number-theory");\nprime-nth(10)'],seeAlso:["number-theory.prime-seq","number-theory.prime-take-while","number-theory.prime?"]},"prime?":{category:"number-theory",description:"Determines if a number is prime.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { prime? } = import("number-theory");\nprime?(1)','let { prime? } = import("number-theory");\nprime?(2)','let { prime? } = import("number-theory");\nprime?(3)','let { prime? } = import("number-theory");\nprime?(4)','let { prime? } = import("number-theory");\nprime?(997)','let { prime? } = import("number-theory");\nprime?(1001)'],seeAlso:["number-theory.prime-seq","number-theory.prime-nth","number-theory.composite?","number-theory.prime-factors","number-theory.mersenne?","number-theory.prime-take-while","number-theory.lucky?"]},"recaman-seq":{category:"number-theory",description:"Generates the Recaman sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { recaman-seq } = import("number-theory");\nrecaman-seq(5)','let { recaman-seq } = import("number-theory");\nrecaman-seq(10)','let { recaman-seq } = import("number-theory");\nrecaman-seq(20)'],seeAlso:["number-theory.recaman-nth","number-theory.recaman-take-while","number-theory.recaman?","number-theory.golomb-seq"]},"recaman-take-while":{category:"number-theory",description:"Generates the Recaman sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { recaman-take-while } = import("number-theory");\nrecaman-take-while(-> $ < 10)'],seeAlso:["number-theory.recaman-seq","number-theory.recaman-nth","number-theory.recaman?"]},"recaman-nth":{category:"number-theory",description:"Generates the nth term of the Recaman sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { recaman-nth } = import("number-theory");\nrecaman-nth(5)','let { recaman-nth } = import("number-theory");\nrecaman-nth(10)','let { recaman-nth } = import("number-theory");\nrecaman-nth(20)'],seeAlso:["number-theory.recaman-seq","number-theory.recaman-take-while","number-theory.recaman?"]},"recaman?":{category:"number-theory",description:"Checks if a number is in the Recaman sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { recaman? } = import("number-theory");\nrecaman?(5)','let { recaman? } = import("number-theory");\nrecaman?(10)','let { recaman? } = import("number-theory");\nrecaman?(20)'],seeAlso:["number-theory.recaman-seq","number-theory.recaman-nth","number-theory.recaman-take-while"]},"sylvester-seq":{category:"number-theory",description:"Generates the Sylvester sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate. If not provided, the default is 6 (the maximum length of the pre-calculated Sylvester numbers)."}},variants:[{argumentNames:["length"]},{argumentNames:[]}],examples:['let { sylvester-seq } = import("number-theory");\nsylvester-seq(5)','let { sylvester-seq } = import("number-theory");\nsylvester-seq()','let { sylvester-seq } = import("number-theory");\nsylvester-seq()'],seeAlso:["number-theory.sylvester-nth","number-theory.sylvester-take-while","number-theory.sylvester?"]},"sylvester-take-while":{category:"number-theory",description:"Generates the Sylvester sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { sylvester-take-while } = import("number-theory");\nsylvester-take-while(-> $ < 100000)'],seeAlso:["number-theory.sylvester-seq","number-theory.sylvester-nth","number-theory.sylvester?"]},"sylvester-nth":{category:"number-theory",description:"Generates the nth term of the Sylvester sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { sylvester-nth } = import("number-theory");\nsylvester-nth(1)','let { sylvester-nth } = import("number-theory");\nsylvester-nth(5)'],seeAlso:["number-theory.sylvester-seq","number-theory.sylvester-take-while","number-theory.sylvester?"]},"sylvester?":{category:"number-theory",description:"Checks if a number is in the Sylvester sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { sylvester? } = import("number-theory");\nsylvester?(2)','let { sylvester? } = import("number-theory");\nsylvester?(3)','let { sylvester? } = import("number-theory");\nsylvester?(6)'],seeAlso:["number-theory.sylvester-seq","number-theory.sylvester-nth","number-theory.sylvester-take-while"]},"thue-morse-seq":{category:"number-theory",description:"Generates the Thue-Morse sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { thue-morse-seq } = import("number-theory");\nthue-morse-seq(5)','let { thue-morse-seq } = import("number-theory");\nthue-morse-seq(10)','let { thue-morse-seq } = import("number-theory");\nthue-morse-seq(20)'],seeAlso:["number-theory.thue-morse-nth","number-theory.thue-morse-take-while","number-theory.thue-morse?"]},"thue-morse-take-while":{category:"number-theory",description:"Generates the Thue-Morse sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { thue-morse-take-while } = import("number-theory");\nthue-morse-take-while(-> $2 < 10)'],seeAlso:["number-theory.thue-morse-seq","number-theory.thue-morse-nth","number-theory.thue-morse?"]},"thue-morse-nth":{category:"number-theory",description:"Generates the nth term of the Thue-Morse sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term in the sequence."}},variants:[{argumentNames:["n"]}],examples:['let { thue-morse-nth } = import("number-theory");\nthue-morse-nth(5)','let { thue-morse-nth } = import("number-theory");\nthue-morse-nth(10)','let { thue-morse-nth } = import("number-theory");\nthue-morse-nth(20)'],seeAlso:["number-theory.thue-morse-seq","number-theory.thue-morse-take-while","number-theory.thue-morse?"]},"thue-morse?":{category:"number-theory",description:"Checks if a number is part of the Thue-Morse sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { thue-morse? } = import("number-theory");\nthue-morse?(1)','let { thue-morse? } = import("number-theory");\nthue-morse?(2)'],seeAlso:["number-theory.thue-morse-seq","number-theory.thue-morse-nth","number-theory.thue-morse-take-while"]},"tribonacci-seq":{category:"number-theory",description:"Generates the tribonacci sequence up to a specified length.",returns:{type:"integer",array:!0},args:{length:{type:"integer",description:"The length of the sequence to generate."}},variants:[{argumentNames:["length"]}],examples:['let { tribonacci-seq } = import("number-theory");\ntribonacci-seq(1)','let { tribonacci-seq } = import("number-theory");\ntribonacci-seq(2)','let { tribonacci-seq } = import("number-theory");\ntribonacci-seq(10)'],seeAlso:["number-theory.tribonacci-nth","number-theory.tribonacci-take-while","number-theory.tribonacci?","number-theory.fibonacci-seq"]},"tribonacci-take-while":{category:"number-theory",description:"Generates the tribonacci sequence while a condition is met.",returns:{type:"integer",array:!0},args:{takeWhile:{type:"function",description:"A function that takes an integer and an index and returns a boolean."}},variants:[{argumentNames:["takeWhile"]}],examples:['let { tribonacci-take-while } = import("number-theory");\ntribonacci-take-while(-> $ < 100)'],seeAlso:["number-theory.tribonacci-seq","number-theory.tribonacci-nth","number-theory.tribonacci?"]},"tribonacci-nth":{category:"number-theory",description:"Generates the nth term of the tribonacci sequence.",returns:{type:"integer"},args:{n:{type:"integer",description:"The index of the term to generate."}},variants:[{argumentNames:["n"]}],examples:['let { tribonacci-nth } = import("number-theory");\ntribonacci-nth(1)','let { tribonacci-nth } = import("number-theory");\ntribonacci-nth(2)','let { tribonacci-nth } = import("number-theory");\ntribonacci-nth(10)'],seeAlso:["number-theory.tribonacci-seq","number-theory.tribonacci-take-while","number-theory.tribonacci?"]},"tribonacci?":{category:"number-theory",description:"Determines if a number is in the tribonacci sequence.",returns:{type:"boolean"},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { tribonacci? } = import("number-theory");\ntribonacci?(0)','let { tribonacci? } = import("number-theory");\ntribonacci?(1)','let { tribonacci? } = import("number-theory");\ntribonacci?(2)','let { tribonacci? } = import("number-theory");\ntribonacci?(3)','let { tribonacci? } = import("number-theory");\ntribonacci?(4)','let { tribonacci? } = import("number-theory");\ntribonacci?(5)','let { tribonacci? } = import("number-theory");\ntribonacci?(6)','let { tribonacci? } = import("number-theory");\ntribonacci?(7)','let { tribonacci? } = import("number-theory");\ntribonacci?(8)','let { tribonacci? } = import("number-theory");\ntribonacci?(9)','let { tribonacci? } = import("number-theory");\ntribonacci?(10)'],seeAlso:["number-theory.tribonacci-seq","number-theory.tribonacci-nth","number-theory.fibonacci?","number-theory.tribonacci-take-while"]},"count-combinations":{category:"number-theory",description:"Calculates the number of combinations of n items taken k at a time.",returns:{type:"integer"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:['let { count-combinations } = import("number-theory");\ncount-combinations(5, 3)','let { count-combinations } = import("number-theory");\ncount-combinations(10, 2)'],seeAlso:["number-theory.combinations","number-theory.count-permutations","number-theory.factorial","number-theory.multinomial","number-theory.stirling-second","number-theory.count-partitions","number-theory.count-power-set"]},combinations:{category:"number-theory",description:"Generates all possible combinations of a specified size from a collection.",returns:{type:"array",array:!0},args:{set:{type:"array",array:!0,description:"The input collection to generate combinations from."},n:{type:"integer",description:"The size of each combination."},a:{type:"array"},b:{type:"integer"}},variants:[{argumentNames:["set","n"]}],examples:['let { combinations } = import("number-theory");\ncombinations([1, 2, 3], 2)','let { combinations } = import("number-theory");\ncombinations(["a", "b", "c"], 2)','let { combinations } = import("number-theory");\ncombinations([1, 2, 3], 0)','let { combinations } = import("number-theory");\ncombinations([1, 2, 3], 1)','let { combinations } = import("number-theory");\ncombinations([1, 2, 3], 3)'],seeAlso:["number-theory.count-combinations","number-theory.permutations","number-theory.power-set","number-theory.cartesian-product","number-theory.partitions"]},"count-derangements":{category:"number-theory",description:"Calculates the number of derangements (permutations where no element appears in its original position) of n items.",returns:{type:"integer"},args:{n:{type:"integer",description:"The total number of items."}},variants:[{argumentNames:["n"]}],examples:['let { count-derangements } = import("number-theory");\ncount-derangements(4)','let { count-derangements } = import("number-theory");\ncount-derangements(5)'],seeAlso:["number-theory.derangements","number-theory.count-permutations","number-theory.factorial"]},derangements:{category:"number-theory",description:"Generates all derangements (permutations where no element appears in its original position) of a set.",returns:{type:"array",array:!0},args:{set:{type:"array",array:!0,description:"The input collection to generate derangements from."}},variants:[{argumentNames:["set"]}],examples:['let { derangements } = import("number-theory");\nderangements([1, 2, 3, 4])','let { derangements } = import("number-theory");\nderangements(["a", "b", "c"])'],seeAlso:["number-theory.count-derangements","number-theory.permutations"]},divisors:{category:"number-theory",description:"Returns the divisors of a number.",returns:{type:"integer",array:!0},args:{n:{type:"integer",description:"The number to find divisors for."}},variants:[{argumentNames:["n"]}],examples:['let { divisors } = import("number-theory");\ndivisors(12)','let { divisors } = import("number-theory");\ndivisors(100)','let { divisors } = import("number-theory");\ndivisors(37)'],seeAlso:["number-theory.count-divisors","number-theory.proper-divisors","number-theory.sigma","number-theory.prime-factors","number-theory.divisible-by?","number-theory.lcm","number-theory.abundant?","number-theory.deficient?","number-theory.count-proper-divisors"]},"count-divisors":{category:"number-theory",description:"Returns the number of divisors of a number.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to count divisors for."}},variants:[{argumentNames:["n"]}],examples:['let { count-divisors } = import("number-theory");\ncount-divisors(12)','let { count-divisors } = import("number-theory");\ncount-divisors(100)','let { count-divisors } = import("number-theory");\ncount-divisors(37)'],seeAlso:["number-theory.divisors","number-theory.count-proper-divisors","number-theory.sigma"]},"proper-divisors":{category:"number-theory",description:"Returns the proper divisors of a number.",returns:{type:"integer",array:!0},args:{n:{type:"integer",description:"The number to find proper divisors for."}},variants:[{argumentNames:["n"]}],examples:['let { proper-divisors } = import("number-theory");\nproper-divisors(12)','let { proper-divisors } = import("number-theory");\nproper-divisors(100)','let { proper-divisors } = import("number-theory");\nproper-divisors(37)'],seeAlso:["number-theory.count-proper-divisors","number-theory.divisors","number-theory.amicable?","number-theory.perfect?"]},"count-proper-divisors":{category:"number-theory",description:"Returns the number of proper divisors of a number.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to count proper divisors for."}},variants:[{argumentNames:["n"]}],examples:['let { count-proper-divisors } = import("number-theory");\ncount-proper-divisors(12)','let { count-proper-divisors } = import("number-theory");\ncount-proper-divisors(100)','let { count-proper-divisors } = import("number-theory");\ncount-proper-divisors(37)'],seeAlso:["number-theory.proper-divisors","number-theory.count-divisors","number-theory.divisors"]},factorial:{category:"number-theory",description:"Calculates the factorial of a number.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to calculate the factorial for."}},variants:[{argumentNames:["n"]}],examples:['let { factorial } = import("number-theory");\nfactorial(5)','let { factorial } = import("number-theory");\nfactorial(0)','let { factorial } = import("number-theory");\nfactorial(10)','let { factorial } = import("number-theory");\nfactorial(20)'],seeAlso:["number-theory.factorial-seq","number-theory.factorial-nth","number-theory.factorial?","number-theory.count-combinations","number-theory.count-permutations","number-theory.multinomial","number-theory.count-derangements"]},partitions:{category:"number-theory",description:"Generates all partitions of a number.",returns:{type:"array",array:!0},args:{n:{type:"integer",description:"The number to partition."}},variants:[{argumentNames:["n"]}],examples:['let { partitions } = import("number-theory");\npartitions(4)','let { partitions } = import("number-theory");\npartitions(8)'],seeAlso:["number-theory.count-partitions","number-theory.partition-seq","number-theory.combinations","number-theory.partition?"]},"count-partitions":{category:"number-theory",description:"Returns the number of partitions of a number.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to count partitions for."}},variants:[{argumentNames:["n"]}],examples:['let { count-partitions } = import("number-theory");\ncount-partitions(4)','let { count-partitions } = import("number-theory");\ncount-partitions(8)','let { count-partitions } = import("number-theory");\ncount-partitions(15)'],seeAlso:["number-theory.partitions","number-theory.partition-seq","number-theory.count-combinations"]},permutations:{category:"number-theory",description:"Generates all permutations of a collection.",returns:{type:"array",array:!0},args:{set:{type:"array",array:!0,description:"The input collection to generate permutations from."}},variants:[{argumentNames:["set"]}],examples:['let { permutations } = import("number-theory");\npermutations([1, 2, 3])','let { permutations } = import("number-theory");\npermutations(["a", "b", "c"])','let { permutations } = import("number-theory");\npermutations([1, 2, 3, 4])','let { permutations } = import("number-theory");\npermutations([1, 2])','let { permutations } = import("number-theory");\npermutations([1])','let { permutations } = import("number-theory");\npermutations([])'],seeAlso:["number-theory.count-permutations","number-theory.combinations","number-theory.derangements","number-theory.cartesian-product"]},"count-permutations":{category:"number-theory",description:"Returns the number of permutations of n items taken k at a time.",returns:{type:"integer"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:['let { count-permutations } = import("number-theory");\ncount-permutations(5, 3)','let { count-permutations } = import("number-theory");\ncount-permutations(10, 2)','let { count-permutations } = import("number-theory");\ncount-permutations(10, 10)','let { count-permutations } = import("number-theory");\ncount-permutations(10, 0)','let { count-permutations } = import("number-theory");\ncount-permutations(10, 1)'],seeAlso:["number-theory.permutations","number-theory.count-combinations","number-theory.factorial","number-theory.multinomial","number-theory.stirling-first","number-theory.count-derangements"]},"power-set":{category:"number-theory",description:"Generates the power set of a collection.",returns:{type:"array",array:!0},args:{set:{type:"any",array:!0,description:"The input collection to generate the power set from."}},variants:[{argumentNames:["set"]}],examples:['let { power-set } = import("number-theory");\npower-set(["a", "b", "c"])','let { power-set } = import("number-theory");\npower-set([1, 2])','let { power-set } = import("number-theory");\npower-set([1])','let { power-set } = import("number-theory");\npower-set([])'],seeAlso:["number-theory.count-power-set","number-theory.combinations","number-theory.cartesian-product"]},"count-power-set":{category:"number-theory",description:"Returns the number of subsets of a set.",returns:{type:"integer"},args:{n:{type:"integer",description:"The size of the set."}},variants:[{argumentNames:["n"]}],examples:['let { count-power-set } = import("number-theory");\ncount-power-set(3)','let { count-power-set } = import("number-theory");\ncount-power-set(5)','let { count-power-set } = import("number-theory");\ncount-power-set(10)'],seeAlso:["number-theory.power-set","number-theory.count-combinations"]},"prime-factors":{category:"number-theory",description:"Returns the prime factors of a number.",returns:{type:"integer",array:!0},args:{n:{type:"integer",description:"The number to factor."}},variants:[{argumentNames:["n"]}],examples:['let { prime-factors } = import("number-theory");\nprime-factors(12)','let { prime-factors } = import("number-theory");\nprime-factors(100)','let { prime-factors } = import("number-theory");\nprime-factors(37)'],seeAlso:["number-theory.count-prime-factors","number-theory.distinct-prime-factors","number-theory.prime?","number-theory.divisors","number-theory.euler-totient","number-theory.mobius","number-theory.composite?","number-theory.count-distinct-prime-factors"]},"count-prime-factors":{category:"number-theory",description:"Returns the number of prime factors of a number.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to count prime factors for."}},variants:[{argumentNames:["n"]}],examples:['let { count-prime-factors } = import("number-theory");\ncount-prime-factors(12)','let { count-prime-factors } = import("number-theory");\ncount-prime-factors(100)','let { count-prime-factors } = import("number-theory");\ncount-prime-factors(37)'],seeAlso:["number-theory.prime-factors","number-theory.distinct-prime-factors","number-theory.count-distinct-prime-factors"]},"distinct-prime-factors":{category:"number-theory",description:"Returns the distinct prime factors of a number.",returns:{type:"integer",array:!0},args:{n:{type:"integer",description:"The number to find distinct prime factors for."}},variants:[{argumentNames:["n"]}],examples:['let { distinct-prime-factors } = import("number-theory");\ndistinct-prime-factors(12)','let { distinct-prime-factors } = import("number-theory");\ndistinct-prime-factors(100)','let { distinct-prime-factors } = import("number-theory");\ndistinct-prime-factors(37)'],seeAlso:["number-theory.prime-factors","number-theory.count-distinct-prime-factors","number-theory.count-prime-factors"]},"count-distinct-prime-factors":{category:"number-theory",description:"Returns the number of distinct prime factors of a number.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to count distinct prime factors for."}},variants:[{argumentNames:["n"]}],examples:['let { count-distinct-prime-factors } = import("number-theory");\ncount-distinct-prime-factors(12)','let { count-distinct-prime-factors } = import("number-theory");\ncount-distinct-prime-factors(100)','let { count-distinct-prime-factors } = import("number-theory");\ncount-distinct-prime-factors(37)'],seeAlso:["number-theory.distinct-prime-factors","number-theory.prime-factors","number-theory.count-prime-factors"]},"coprime?":{category:"number-theory",description:"Checks if two numbers are coprime (i.e., their GCD is 1).",returns:{type:"boolean"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:['let { coprime? } = import("number-theory");\ncoprime?(12, 8)','let { coprime? } = import("number-theory");\ncoprime?(12, 5)','let { coprime? } = import("number-theory");\ncoprime?(37, 1)','let { coprime? } = import("number-theory");\ncoprime?(0, 0)','let { coprime? } = import("number-theory");\ncoprime?(0, 5)','let { coprime? } = import("number-theory");\ncoprime?(5, 0)','let { coprime? } = import("number-theory");\ncoprime?(1, 0)','let { coprime? } = import("number-theory");\ncoprime?(0, 1)','let { coprime? } = import("number-theory");\ncoprime?(1, 1)','let { coprime? } = import("number-theory");\ncoprime?(2, 3)'],seeAlso:["number-theory.gcd","number-theory.euler-totient","number-theory.divisible-by?","number-theory.lcm","number-theory.carmichael-lambda"]},"divisible-by?":{category:"number-theory",description:"Checks if a number is divisible by another number.",returns:{type:"boolean"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:['let { divisible-by? } = import("number-theory");\ndivisible-by?(12, 4)','let { divisible-by? } = import("number-theory");\ndivisible-by?(12, 5)','let { divisible-by? } = import("number-theory");\ndivisible-by?(37, 1)','let { divisible-by? } = import("number-theory");\ndivisible-by?(0, 0)','let { divisible-by? } = import("number-theory");\ndivisible-by?(0, 5)','let { divisible-by? } = import("number-theory");\ndivisible-by?(5, 0)'],seeAlso:["number-theory.divisors","number-theory.gcd","number-theory.coprime?"]},gcd:{category:"number-theory",description:"Calculates the greatest common divisor (GCD) of two numbers.",returns:{type:"integer"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:['let { gcd } = import("number-theory");\ngcd(100, 25)','let { gcd } = import("number-theory");\ngcd(37, 1)','let { gcd } = import("number-theory");\ngcd(0, 0)','let { gcd } = import("number-theory");\ngcd(0, 5)','let { gcd } = import("number-theory");\ngcd(5, 0)'],seeAlso:["number-theory.lcm","number-theory.extended-gcd","number-theory.coprime?","number-theory.divisible-by?"]},lcm:{category:"number-theory",description:"Calculates the least common multiple (LCM) of two numbers.",returns:{type:"integer"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:['let { lcm } = import("number-theory");\nlcm(100, 25)','let { lcm } = import("number-theory");\nlcm(37, 1)','let { lcm } = import("number-theory");\nlcm(0, 5)','let { lcm } = import("number-theory");\nlcm(5, 0)'],seeAlso:["number-theory.gcd","number-theory.divisors","number-theory.coprime?"]},multinomial:{category:"number-theory",description:"Calculates the multinomial coefficient from of a list of numbers representing the sizes of each group.",returns:{type:"integer"},args:{args:{type:"integer",rest:!0,description:"The numbers representing the sizes of each group."}},variants:[{argumentNames:["args"]}],examples:['let { multinomial } = import("number-theory");\nmultinomial(5, 2, 3)','let { multinomial } = import("number-theory");\nmultinomial(10, 2, 3, 5)'],seeAlso:["number-theory.count-combinations","number-theory.factorial","number-theory.count-permutations"],hideOperatorForm:!0},"amicable?":{category:"number-theory",description:"Checks if two numbers are amicable (i.e., the sum of the proper divisors of each number equals the other number).",returns:{type:"boolean"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:['let { amicable? } = import("number-theory");\namicable?(220, 284)','let { amicable? } = import("number-theory");\namicable?(1184, 1210)','let { amicable? } = import("number-theory");\namicable?(2620, 2924)','let { amicable? } = import("number-theory");\namicable?(5020, 5564)','let { amicable? } = import("number-theory");\namicable?(6232, 6368)'],seeAlso:["number-theory.proper-divisors","number-theory.perfect?","number-theory.sigma","number-theory.perfect-seq"]},"euler-totient":{category:"number-theory",description:"Calculates the Euler's totient function (φ(n)) of a number, which counts the integers up to n that are coprime to n.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to calculate the totient for."}},variants:[{argumentNames:["n"]}],examples:['let { euler-totient } = import("number-theory");\neuler-totient(1)','let { euler-totient } = import("number-theory");\neuler-totient(2)','let { euler-totient } = import("number-theory");\neuler-totient(10)','let { euler-totient } = import("number-theory");\neuler-totient(20)'],seeAlso:["number-theory.coprime?","number-theory.carmichael-lambda","number-theory.mobius","number-theory.prime-factors","number-theory.mertens"]},mobius:{category:"number-theory",description:"Calculates the Möbius function (μ(n)) of a number, which is used in number theory.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to calculate the Möbius function for."}},variants:[{argumentNames:["n"]}],examples:['let { mobius } = import("number-theory");\nmobius(1)','let { mobius } = import("number-theory");\nmobius(2)','let { mobius } = import("number-theory");\nmobius(3)','let { mobius } = import("number-theory");\nmobius(4)','let { mobius } = import("number-theory");\nmobius(6)','let { mobius } = import("number-theory");\nmobius(12)','let { mobius } = import("number-theory");\nmobius(30)'],seeAlso:["number-theory.mertens","number-theory.euler-totient","number-theory.prime-factors"]},mertens:{category:"number-theory",description:"Calculates the Mertens function (M(n)) of a number, which is the sum of the Möbius function up to n.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to calculate the Mertens function for."}},variants:[{argumentNames:["n"]}],examples:['let { mobius } = import("number-theory");\nmobius(1)','let { mobius } = import("number-theory");\nmobius(2)','let { mobius } = import("number-theory");\nmobius(3)','let { mobius } = import("number-theory");\nmobius(4)','let { mobius } = import("number-theory");\nmobius(6)','let { mobius } = import("number-theory");\nmobius(12)','let { mobius } = import("number-theory");\nmobius(30)'],seeAlso:["number-theory.mobius","number-theory.euler-totient"]},sigma:{category:"number-theory",description:"Calculates the sum of divisors function (σ(n)) of a number, which is the sum of all positive divisors of n.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to calculate the sum of divisors for."}},variants:[{argumentNames:["n"]}],examples:['let { sigma } = import("number-theory");\nsigma(1)','let { sigma } = import("number-theory");\nsigma(2)','let { sigma } = import("number-theory");\nsigma(3)','let { sigma } = import("number-theory");\nsigma(4)','let { sigma } = import("number-theory");\nsigma(6)','let { sigma } = import("number-theory");\nsigma(12)','let { sigma } = import("number-theory");\nsigma(30)'],seeAlso:["number-theory.divisors","number-theory.perfect?","number-theory.abundant?","number-theory.deficient?","number-theory.amicable?","number-theory.count-divisors"]},"carmichael-lambda":{category:"number-theory",description:"Calculates the Carmichael function (λ(n)) of a number, which is the smallest positive integer m such that a^m ≡ 1 (mod n) for all integers a coprime to n.",returns:{type:"integer"},args:{n:{type:"integer",description:"The number to calculate the Carmichael function for."}},variants:[{argumentNames:["n"]}],examples:['let { carmichael-lambda } = import("number-theory");\ncarmichael-lambda(1)','let { carmichael-lambda } = import("number-theory");\ncarmichael-lambda(2)','let { carmichael-lambda } = import("number-theory");\ncarmichael-lambda(3)','let { carmichael-lambda } = import("number-theory");\ncarmichael-lambda(4)','let { carmichael-lambda } = import("number-theory");\ncarmichael-lambda(6)','let { carmichael-lambda } = import("number-theory");\ncarmichael-lambda(12)','let { carmichael-lambda } = import("number-theory");\ncarmichael-lambda(30)'],seeAlso:["number-theory.euler-totient","number-theory.mod-exp","number-theory.coprime?"]},"cartesian-product":{category:"number-theory",description:"Calculates the Cartesian product of two or more sets.",returns:{type:"array",array:!0},args:{sets:{type:"array",array:!0,description:"The input collections to calculate the Cartesian product from."},a:{type:"array"},b:{type:"array"}},variants:[{argumentNames:["sets"]}],examples:['let { cartesian-product } = import("number-theory");\ncartesian-product([1, 2], ["a", "b"])','let { cartesian-product } = import("number-theory");\ncartesian-product([1, 2], ["a", "b"], [true, false])','let { cartesian-product } = import("number-theory");\ncartesian-product([1, 2, 3], ["x", "y", "z"])'],seeAlso:["number-theory.combinations","number-theory.power-set","number-theory.permutations"]},"perfect-power":{category:"number-theory",description:"Returns a tuple of the base and exponent if the number is a perfect power, otherwise returns null.",returns:{type:"array",array:!0},args:{n:{type:"integer",description:"The number to check."}},variants:[{argumentNames:["n"]}],examples:['let { perfect-power } = import("number-theory");\nperfect-power(1)','let { perfect-power } = import("number-theory");\nperfect-power(2)','let { perfect-power } = import("number-theory");\nperfect-power(4)','let { perfect-power } = import("number-theory");\nperfect-power(8)','let { perfect-power } = import("number-theory");\nperfect-power(9)','let { perfect-power } = import("number-theory");\nperfect-power(16)','let { perfect-power } = import("number-theory");\nperfect-power(19)'],seeAlso:["number-theory.perfect-power?","number-theory.perfect-power-seq","number-theory.perfect-square?","number-theory.perfect-cube?"]},"mod-exp":{category:"number-theory",description:"Calculates the modular exponentiation of a base raised to an exponent modulo a modulus.",returns:{type:"integer"},args:{base:{type:"integer"},exponent:{type:"integer"},modulus:{type:"integer"}},variants:[{argumentNames:["base","exponent","modulus"]}],examples:['let { mod-exp } = import("number-theory");\nmod-exp(2, 3, 5)','let { mod-exp } = import("number-theory");\nmod-exp(3, 4, 7)','let { mod-exp } = import("number-theory");\nmod-exp(5, 6, 11)','let { mod-exp } = import("number-theory");\nmod-exp(7, 8, 13)'],seeAlso:["number-theory.mod-inv","number-theory.carmichael-lambda","number-theory.chinese-remainder"]},"mod-inv":{category:"number-theory",description:"Calculates the modular multiplicative inverse of a number modulo another number.",returns:{type:"integer"},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","m"]}],examples:['let { mod-inv } = import("number-theory");\nmod-inv(3, 11)','let { mod-inv } = import("number-theory");\nmod-inv(10, 17)','let { mod-inv } = import("number-theory");\nmod-inv(5, 13)','let { mod-inv } = import("number-theory");\nmod-inv(7, 19)'],seeAlso:["number-theory.mod-exp","number-theory.extended-gcd","number-theory.chinese-remainder"]},"extended-gcd":{category:"number-theory",description:"Calculates the extended greatest common divisor (GCD) of two numbers, returning the GCD and the coefficients of Bézout's identity.",returns:{type:"integer",array:!0},args:{a:{type:"integer"},b:{type:"integer"}},variants:[{argumentNames:["a","b"]}],examples:['let { extended-gcd } = import("number-theory");\nextended-gcd(30, 12)','let { extended-gcd } = import("number-theory");\nextended-gcd(56, 98)','let { extended-gcd } = import("number-theory");\nextended-gcd(101, 10)','let { extended-gcd } = import("number-theory");\nextended-gcd(17, 13)'],seeAlso:["number-theory.gcd","number-theory.mod-inv","number-theory.chinese-remainder"]},"chinese-remainder":{category:"number-theory",description:"Solves a system of simultaneous congruences using the Chinese Remainder Theorem.",returns:{type:"integer"},args:{remainders:{type:"integer",array:!0,description:"The remainders of the congruences."},moduli:{type:"integer",array:!0,description:"The moduli of the congruences."},a:{type:"array"},b:{type:"array"}},variants:[{argumentNames:["remainders","moduli"]}],examples:['let { chinese-remainder } = import("number-theory");\nchinese-remainder([2, 3], [3, 5])','let { chinese-remainder } = import("number-theory");\nchinese-remainder([1, 2], [3, 4])','let { chinese-remainder } = import("number-theory");\nchinese-remainder([0, 1], [2, 3])','let { chinese-remainder } = import("number-theory");\nchinese-remainder([1, 2, 3], [4, 5, 7])'],seeAlso:["number-theory.mod-exp","number-theory.mod-inv","number-theory.extended-gcd"]},"stirling-first":{category:"number-theory",description:"Calculates the Stirling numbers of the first kind, which count the number of permutations of n elements with k cycles.",returns:{type:"integer"},args:{a:{type:"integer",description:"The number of elements."},b:{type:"integer",description:"The number of cycles."}},variants:[{argumentNames:["a","b"]}],examples:['let { stirling-first } = import("number-theory");\nstirling-first(5, 2)','let { stirling-first } = import("number-theory");\nstirling-first(4, 3)','let { stirling-first } = import("number-theory");\nstirling-first(6, 1)','let { stirling-first } = import("number-theory");\nstirling-first(7, 4)','let { stirling-first } = import("number-theory");\nstirling-first(8, 5)'],seeAlso:["number-theory.stirling-second","number-theory.bell-seq","number-theory.count-permutations"]},"stirling-second":{category:"number-theory",description:"Calculates the Stirling numbers of the second kind, which count the number of ways to partition n elements into k non-empty subsets.",returns:{type:"integer"},args:{a:{type:"integer",description:"The number of elements."},b:{type:"integer",description:"The number of subsets."}},variants:[{argumentNames:["a","b"]}],examples:['let { stirling-second } = import("number-theory");\nstirling-second(5, 2)','let { stirling-second } = import("number-theory");\nstirling-second(4, 3)','let { stirling-second } = import("number-theory");\nstirling-second(6, 1)','let { stirling-second } = import("number-theory");\nstirling-second(7, 4)','let { stirling-second } = import("number-theory");\nstirling-second(8, 5)'],seeAlso:["number-theory.stirling-first","number-theory.bell-seq","number-theory.count-combinations"]}};function N(e,t){if(0===t||t===e)return 1;let r=1;for(let n=0;n<t;n++)r*=(e-n)/(n+1);return r}function T(e,t){if(1===t)return e.map(e=>[e]);const r=[];for(let n=0;n<=e.length-t;n++){const o=e[n],i=T(e.slice(n+1),t-1);for(const e of i)r.push([o,...e])}return r}const G={combinations:{evaluate:([e,t],r)=>(d(e,r),l(t,r,{integer:!0,nonNegative:!0,lte:e.length}),0===t?[[]]:T(e,t)),arity:x(2)},"count-combinations":{evaluate:([e,t],r)=>(l(e,r,{integer:!0,nonNegative:!0}),l(t,r,{integer:!0,nonNegative:!0,lte:e}),N(e,t)),arity:x(2)}};const $={derangements:{evaluate:([e],t)=>(d(e,t),function(e){const t=e.length,r=[],n=Array.from({length:t},()=>!1),o=Array.from({length:t});return function i(a){if(a!==t)for(let r=0;r<t;r++)n[r]||r===a||(n[r]=!0,o[a]=e[r],i(a+1),n[r]=!1);else r.push([...o])}(0),r}(e)),arity:x(1)},"count-derangements":{evaluate:([e],t)=>(l(e,t,{finite:!0,integer:!0,positive:!0}),function(e){if(1===e)return 0;let t=1,r=0,n=0;for(let o=2;o<=e;o++)n=(o-1)*(t+r),t=r,r=n;return n}(e)),arity:x(1)}};function C(e){const t=[];for(let r=1;r<=Math.sqrt(e);r++)e%r===0&&(t.push(r),r!==e/r&&t.push(e/r));return t}function W(e){return C(e).sort((e,t)=>e-t)}function M(e){return W(e).slice(0,-1)}const S={divisors:{evaluate:([e],t)=>(l(e,t,{finite:!0,integer:!0,positive:!0}),W(e)),arity:x(1)},"count-divisors":{evaluate:([e],t)=>(l(e,t,{finite:!0,integer:!0,positive:!0}),C(e).length),arity:x(1)},"proper-divisors":{evaluate:([e],t)=>(l(e,t,{finite:!0,integer:!0,positive:!0}),M(e)),arity:x(1)},"count-proper-divisors":{evaluate:([e],t)=>(l(e,t,{finite:!0,integer:!0,positive:!0}),C(e).length-1),arity:x(1)}},E=[1,1,2,6,24,120,720,5040,40320,362880,3628800,39916800,479001600,6227020800,87178291200,1307674368e3,20922789888e3,355687428096e3,6402373705728e3];function R(e){if(e<0)throw new Error("Factorial is not defined for negative numbers");if(0===e||1===e)return 1;if(e<=18)return E[e];let t=E[18];for(let r=19;r<=e;r++)t*=r;return t}const I={factorial:{evaluate:([e],t)=>(l(e,t,{integer:!0,nonNegative:!0,lte:170}),R(e)),arity:x(1)}},z=[1,2,3,5,7,11,15,22,30,42,56,77,101,135,176,231,297,385,490,627,792,1002,1255,1575,1958,2436,3010,3718,4565,5604,6842,8349,10143,12310,14883,17977,21637,26015,31185,37338,44583,53174,63261,75175,89134,105558,124754,147273,173525,204226,239943,281589,329931,386155,451276,526823,614154,715220,831820,966467,1121505,1300156,1505499,1741630,2012558,2323520,2679689,3087735,3554345,4087968,4697205,5392783,6185689,7089500,8118264,9289091,10619863,12132164,13848650,15796476,18004327,20506255,23338469,26543660,30167357,34262962,38887673,44108109,49995925,56634173,64112359,72533807,82010177,92669720,104651419,118114304,133230930,150198136,169229875,190569292,214481126,241265379,271248950,304801365,342325709,384276336,431149389,483502844,541946240,607163746,679903203,761002156,851376628,952050665,1064144451,1188908248,1327710076,1482074143,1653668665,1844349560,2056148051,2291320912,2552338241,2841940500,3163127352,3519222692,3913864295,4351078600,4835271870,5371315400,5964539504,6620830889,7346629512,8149040695,9035836076,10015581680,11097645016,12292341831,13610949895,15065878135,16670689208,18440293320,20390982757,22540654445,24908858009,27517052599,30388671978,33549419497,37027355200,40853235313,45060624582,49686288421,54770336324,60356673280,66493182097,73232243759,80630964769,88751778802,97662728555,107438159466,118159068427,129913904637,142798995930,156919475295,172389800255,189334822579,207890420102,228204732751,250438925115,274768617130,301384802048,330495499613,362326859895,397125074750,435157697830,476715857290,522115831195,571701605655,625846753120,684957390936,749474411781,819876908323,896684817527,980462880430,0xf98dace281,1171432692373,1280011042268,1398341745571,1527273599625,1667727404093,1820701100652,1987276856363,2168627105469,2366022741845,2580840212973,2814570987591,3068829878530,3345365983698,3646072432125,3972999029388,4328363658647,4714566886083,5134205287973,5590088317495,6085253859260,6622987708040,7206841706490,7840656226137,8528581302375,9275102575355,0x92c1cc50847,0x9f8afdf968b,0xad6918d4f36,0xbc72dde1287,0xccc0de0d1d7,0xde6da02b061,0xf195c5ba10a,18028182516671,19573856161145,21248279009367,23061871173849,25025873760111,27152408925615,29454549941750,31946390696157,34643126322519,37561133582570,40718063627362,44132934884255,47826239745920,51820051838712,56138148670947,60806135438329,65851585970275,71304185514919,77195892663512,83561103925871,90436839668817,97862933703585,0x604ca1b434ad,0x682ca0bc6d4e,0x70ad06a4328b,0x79da3e8e4df8,0x83c1a359c63d,0x8e7190d8114a,0x99f976fff202,0xa669edb53a4a,0xb3d4caca1bc8,0xc24d38b78151,0xd1e7cfd30909,0xe2bab064772f,0xf4dd9f8523e3,290726957916112,313891991306665,338854264248680,365749566870782,394723676655357,425933084409356,459545750448675,495741934760846,534715062908609,576672674947168,621837416509615,670448123060170,722760953690372,779050629562167,839611730366814,904760108316360,974834369944625,0x3bb262854d36d,0x404dafd2efa2e,0x4541ae2536f6d,0x4a94ddd83ba57,0x504e363fd1eca,0x56752ddfc97e7,0x5d11c356f6b53,0x642c86bff69f5,0x6bcea3db036a0,0x7401ecbfdbd63,0x7cd0e571c49d4,0x8646d010a1b6f,0x906fba0855202,0x9b5889f52508f,0xa70f0ea631153,0xb3a20ef033ec5,0xc1215ac210755,0xcf9ddd28cfa8d,0xdf29afbd9f60e,0xefd82f26a7157,4534253126900886,4872038056472084,5234371069753672,5622992691950605,6039763882095515,6486674127079088,6965850144195831,7479565078510584,8030248384943040,8620496275465025];const j={partitions:{evaluate:([e],t)=>(l(e,t,{integer:!0,nonNegative:!0}),function(e){if(e<=0)return[[]];if(1===e)return[[1]];const t=[];return function e(r,n,o){if(0!==r)for(let t=Math.min(n,r);t>=1;t--)o.push(t),e(r-t,t,o),o.pop();else t.push([...o])}(e,e,[]),t}(e)),arity:x(1)},"count-partitions":{evaluate:([e],r)=>{if(l(e,r,{integer:!0,nonNegative:!0}),0===e)return 1;if(e>z.length)throw new t(`n is too large. The maximum value is ${z.length-1}.`,r);return z[e-1]},arity:x(1)}};function P(e){if(0===e.length)return[[]];const t=[];for(let r=0;r<e.length;r++){const n=e[r],o=P([...e.slice(0,r),...e.slice(r+1)]);for(const e of o)t.push([n,...e])}return t}const D={permutations:{evaluate:([e],t)=>(d(e,t),P(e)),arity:x(1)},"count-permutations":{evaluate:([e,t],r)=>(l(e,r,{integer:!0,nonNegative:!0}),l(t,r,{integer:!0,nonNegative:!0,lte:e}),R(e)/R(e-t)),arity:x(2)}};const F={"power-set":{evaluate:([e],t)=>(d(e,t),function(e){const t=[[]];for(const r of e){const e=t.map(e=>[...e,r]);t.push(...e)}return t}(e)),arity:x(1)},"count-power-set":{evaluate:([e],t)=>(l(e,t,{integer:!0,nonNegative:!0}),e>=53?1/0:2**e),arity:x(1)}};function B(e){if(1===e)return[];const t=[];let r=2;for(;e>1;)e%r===0?(t.push(r),e/=r):r++;return t}const L={"prime-factors":{evaluate:([e],t)=>(l(e,t,{finite:!0,integer:!0,positive:!0}),B(e)),arity:x(1)},"distinct-prime-factors":{evaluate:([e],t)=>{l(e,t,{finite:!0,integer:!0,positive:!0});const r=B(e),n=new Set(r);return Array.from(n)},arity:x(1)},"count-prime-factors":{evaluate:([e],t)=>(l(e,t,{finite:!0,integer:!0,positive:!0}),B(e).length),arity:x(1)},"count-distinct-prime-factors":{evaluate:([e],t)=>{l(e,t,{finite:!0,integer:!0,positive:!0});const r=B(e);return new Set(r).size},arity:x(1)}};function O(e,t){return e instanceof Promise?e.then(t):t(e)}function _(e){return M(e).reduce((e,t)=>e+t,0)>e}const J={"abundant-seq":e=>{const t=[];let r=2;for(;t.length<e;)_(r)&&t.push(r),r+=1;return t},"abundant?":e=>_(e),"abundant-take-while":e=>{const t=[];return function r(n){return _(n)?O(e(n,t.length),e=>e?(t.push(n),r(n+1)):t):r(n+1)}(2)}};function X(e,t,r=1e-10){if(e===t)return!0;const n=Math.abs(e-t);if(0===e||0===t||n<r)return n<r;return n/(Math.abs(e)+Math.abs(t))<r}const U={"arithmetic-seq":{evaluate:([e,t,r],n)=>(l(e,n,{finite:!0}),l(t,n,{finite:!0}),l(r,n,{integer:!0,positive:!0}),Array.from({length:r},(r,n)=>e+n*t)),arity:x(3)},"arithmetic-take-while":{evaluate:([e,t,r],n,o,{executeFunction:i})=>{l(e,n,{finite:!0}),l(t,n,{finite:!0}),w(r,n);const a=e,s=t,m=r,u=[];return function e(t){const r=a+t*s;return O(i(m,[r,t],o,n),n=>n?(u.push(r),e(t+1)):u)}(0)},arity:x(3)},"arithmetic-nth":{evaluate:([e,t,r],n)=>(l(e,n,{finite:!0}),l(t,n,{finite:!0}),l(r,n,{integer:!0,positive:!0}),e+(r-1)*t),arity:x(3)},"arithmetic?":{evaluate:([e,t,r],n)=>(l(r,n),l(e,n,{finite:!0}),l(t,n,{finite:!0}),function(e,t,r){if(0===t)return X(r,e);const n=(r-e)/t;if(n<0)return!1;const o=Math.round(n),i=e+t*o;return X(n,o)&&X(i,r)}(e,t,r)),arity:x(3)}};function Z(e){const t=[1];for(let r=1;r<e;r+=1){let e=0;for(let n=0;n<r;n+=1)e+=N(r+1,n)*t[n];t[r]=r>1&&r%2==1?0:-e/(r+1)}return t}const H={"bernoulli-seq":{evaluate:([e],t)=>(l(e,t,{integer:!0,positive:!0}),Z(e)),arity:x(1)},"bernoulli-nth":{evaluate:([e],t)=>{l(e,t,{integer:!0,positive:!0});return Z(e)[e-1]},arity:x(1)},"bernoulli-take-while":{evaluate:([e],t,r,{executeFunction:n})=>{w(e,t);const o=e;return function(e){const t=[1];return function r(n){let o=0;for(let e=0;e<n;e++)o+=N(n+1,e)*t[e];const i=n>1&&n%2==1?0:-o/(n+1);return O(e(i,n),e=>e?(t.push(i),r(n+1)):t)}(1)}((e,t)=>O(n(o,[e,t],r),e=>!!e))},arity:x(1)}};function K(e){if(e<=1)return!1;if(e<=3)return!0;if(e%2==0||e%3==0)return!1;for(let t=5;t*t<=e;t+=6)if(e%t===0||e%(t+2)===0)return!1;return!0}const Q={"prime-seq":e=>{const t=[];let r=2;for(;t.length<e;)K(r)&&t.push(r),r+=1;return t},"prime?":e=>K(e),"prime-take-while":e=>{const t=[];return function r(n){return K(n)?O(e(n,t.length),e=>e?(t.push(n),r(n+1)):t):r(n+1)}(2)}};function V(e){return!(e<=1)&&!K(e)}const Y={"composite-seq":e=>{const t=[];let r=2;for(;t.length<e;)V(r)&&t.push(r),r+=1;return t},"composite?":e=>V(e),"composite-take-while":e=>{const t=[];return function r(n){return V(n)?O(e(n,t.length),e=>e?(t.push(n),r(n+1)):t):r(n+1)}(4)}};function ee(e){return M(e).reduce((e,t)=>e+t,0)<e}const te={"deficient-seq":e=>{const t=[];let r=1;for(;t.length<e;)ee(r)&&t.push(r),r+=1;return t},"deficient?":e=>ee(e),"deficient-take-while":e=>{const t=[];return function r(n){return ee(n)?O(e(n,t.length),e=>e?(t.push(n),r(n+1)):t):r(n+1)}(1)}};const re={"geometric-seq":{evaluate:([e,t,r],n)=>(l(e,n,{finite:!0}),l(t,n,{finite:!0}),l(r,n,{integer:!0,positive:!0}),Array.from({length:r},(r,n)=>e*t**n)),arity:x(3)},"geometric-take-while":{evaluate:([e,t,r],n,o,{executeFunction:i})=>{l(e,n,{finite:!0}),l(t,n,{finite:!0}),w(r,n);const a=e,s=t,m=r,u=[];return function e(t){const r=a*s**t;return O(i(m,[r,t],o,n),n=>n?(u.push(r),e(t+1)):u)}(0)},arity:x(3)},"geometric-nth":{evaluate:([e,t,r],n)=>(l(e,n,{finite:!0}),l(t,n,{finite:!0}),l(r,n,{integer:!0,positive:!0}),e*t**(r-1)),arity:x(3)},"geometric?":{evaluate:([e,t,r],n)=>(l(r,n),l(e,n,{finite:!0}),l(t,n,{finite:!0}),function(e,t,r){if(X(e,0))return X(r,0);if(X(t,1))return X(r,e);if(X(t,0))return X(r,0)||X(r,e);if(X(r,e))return!0;if(X(t,-1))return X(r,e)||X(r,-e);if(t<0){const n=Math.log(Math.abs(r/e))/Math.log(Math.abs(t)),o=Math.round(n);if(!X(o,n)||o<0)return!1;const i=o%2==0?Math.sign(e):Math.sign(e)*Math.sign(t);return Math.sign(r)===i}if(t>1&&r<e||t<1&&r>e)return!1;const n=Math.log(r/e)/Math.log(t),o=Math.round(n);return!(!X(o,n)||o<0)&&X(e*t**o,r)}(e,t,r)),arity:x(3)}};const ne={"golomb-seq":e=>function(e){const t=[0,1];for(let r=2;r<=e;r+=1)t.push(1+t[r-t[t[r-1]]]);return t.slice(1)}(e),"golomb?":()=>!0,"golomb-take-while":e=>function(e){const t=[0,1];return O(e(1,0),r=>r?function r(n){const o=1+t[n-t[t[n-1]]];return O(e(o,n-1),e=>e?(t.push(o),r(n+1)):t.slice(1))}(2):[])}(e)};function oe(e){if(e<=0)return!1;const t=new Set;for(;1!==e&&!t.has(e);)t.add(e),e=ie(e);return 1===e}function ie(e){let t=0;for(;e>0;){const r=e%10;t+=r*r,e=Math.floor(e/10)}return t}const ae={"happy-seq":e=>{const t=[];for(let r=1;t.length<e;r++){let e=r;const n=new Set;for(;1!==e&&!n.has(e);)n.add(e),e=String(e).split("").reduce((e,t)=>e+Number(t)**2,0);1===e&&t.push(r)}return t},"happy?":e=>oe(e),"happy-take-while":e=>{const t=[];return function r(n){return oe(n)?O(e(n,t.length),e=>e?(t.push(n),r(n+1)):t):r(n+1)}(1)}},se={"juggler-seq":e=>{let t=e;const r=[t];for(;t>1;)t=t%2==0?Math.floor(Math.sqrt(t)):Math.floor(t**1.5),r.push(t);return r},noNth:!0};function me(e){let t="",r=1;for(let n=0;n<e.length;n++)n+1<e.length&&e[n]===e[n+1]?r++:(t+=r.toString()+e[n],r=1);return t}const ue={string:!0,"look-and-say-seq":e=>{const t=["1"];for(let r=1;r<e;r+=1){const e=t[r-1].replace(/(\d)\1*/g,e=>`${e.length}${e[0]}`);t[r]=e}return t},"look-and-say-take-while":e=>{const t=[];return O(e("1",0),r=>{if(!r)return t;return t.push("1"),function r(n){const o=t[n-1].replace(/(\d)\1*/g,e=>`${e.length}${e[0]}`);return O(e(o,n),e=>e?(t.push(o),r(n+1)):t)}(1)})},"look-and-say?":e=>function(e){let t="1";if(t===e)return!0;for(;;){if(t=me(t),t===e)return!0;if(t.length>e.length)return!1}}(e)};function he(e){const t=[];for(let e=1;e<=2e3;e++)t.push(e);let r=[1];for(let e=1;e<t.length;e++)t[e]%2!=0&&r.push(t[e]);const n=[1];let o=1;return O(e(1,0),t=>{if(!t)return[];let i=1;return function t(){const a=r[i];return O(e(a,o),e=>{if(!e)return n;n.push(a),o++;const s=a,m=[];for(let e=0;e<r.length;e++)(e+1)%s!==0&&m.push(r[e]);if(r=m,i++,i>=r.length-5){let e=r[r.length-1]+2;for(;r.length<i+1e3;)r.push(e),e+=2}return t()})}()})}const ce={"lucky-seq":e=>function(e){const t=[];let r=1;const n=e*(e<100?20:30);for(;t.length<n;)t.push(r),r+=2;let o=1;for(;o<t.length&&o<e;){const e=t[o];let r=0;for(let n=0;n<t.length;n++)(n+1)%e!==0&&(t[r++]=t[n]);t.length=r,o<t.length&&o++}return t.slice(0,e)}(e),"lucky?":e=>he(t=>t<=e).includes(e),"lucky-take-while":e=>he(e)};const le={"padovan-seq":e=>{const t=[1,1,1];for(let r=3;r<e;r+=1)t[r]=t[r-2]+t[r-3];return t.slice(0,e)},"padovan?":e=>function(e){if(!Number.isInteger(e)||e<=0)return!1;if(1===e)return!0;const t=[1,1,1,2,2,3,4,5,7,9,12,16,21,28,37,49,65,86,114,151,200,265,351,465,616,816,1081,1432,1897,2513,3329,4410,5842,7739,10252,13581,17991,23833,31572,41824,55405,73396,97229];if(t.includes(e))return!0;if(e>t[t.length-1]&&e<=Number.MAX_SAFE_INTEGER){let r,n=t[t.length-3],o=t[t.length-2],i=t[t.length-1];for(;i<e;){if(r=n+o,n=o,o=i,i=r,i===e)return!0;if(!Number.isSafeInteger(i))return!1}}return!1}(e),"padovan-take-while":e=>{const t=[];return O(e(1,0),r=>r?(t.push(1),O(e(1,1),r=>r?(t.push(1),O(e(1,2),r=>{if(!r)return t;t.push(1);let n=1,o=1,i=1;return function r(a){const s=n+o;return n=o,o=i,i=s,O(e(i,a),e=>e?(t.push(i),r(a+1)):t)}(4)})):t)):t)}},pe={"perfect-cube-seq":e=>{const t=[];for(let r=1;r<=e;r++)t.push(r**3);return t},"perfect-cube?":e=>e>0&&Number.isInteger(Math.cbrt(e)),"perfect-cube-take-while":e=>{const t=[];return function r(n){const o=n**3;return O(e(o,n),e=>e?(t.push(o),r(n+1)):t)}(1)}};function ye(e){if(e<2)return 1===e?[1,2]:null;const t=Math.floor(Math.log2(e))+1;for(let r=2;r<=t;r++){const t=e**(1/r),n=Math.round(t);if(X(n**r,e))return[n,r]}return null}const be={"perfect-power-seq":e=>{const t=[];for(let r=1;t.length<e;r++)ye(r)&&t.push(r);return t},"perfect-power?":e=>null!==ye(e),"perfect-power-take-while":e=>{const t=[];return function r(n){return ye(n)?O(e(n,t.length),e=>e?(t.push(n),r(n+1)):t):r(n+1)}(1)}},ge={"perfect-square-seq":e=>{const t=[];for(let r=1;r<=e;r++)t.push(r**2);return t},"perfect-square?":e=>e>0&&Number.isInteger(Math.sqrt(e)),"perfect-square-take-while":e=>{const t=[];return function r(n){const o=n**2;return O(e(o,n),e=>e?(t.push(o),r(n+1)):t)}(1)}},fe={"polygonal-seq":{evaluate:([e,t],r)=>{l(e,r,{integer:!0,gte:3}),l(t,r,{integer:!0,positive:!0});const n=[];for(let r=1;r<=t;r+=1)n[r-1]=(r*r*(e-2)-r*(e-4))/2;return n},arity:x(2)},"polygonal-take-while":{evaluate:([e,t],r,n,{executeFunction:o})=>{l(e,r,{integer:!0,gte:3}),w(t,r);const i=e,a=t,s=[];return function e(t){const m=(t*t*(i-2)-t*(i-4))/2;return O(o(a,[m,t],n,r),r=>r?(s.push(m),e(t+1)):s)}(1)},arity:x(2)},"polygonal-nth":{evaluate:([e,t],r)=>(l(e,r,{integer:!0,gte:3}),l(t,r,{integer:!0,positive:!0}),(t*t*(e-2)-t*(e-4))/2),arity:x(2)},"polygonal?":{evaluate:([e,t],r)=>{if(l(t,r,{integer:!0}),l(e,r,{integer:!0,gte:3}),t<=0)return!1;const n=e-2,o=e-4,i=8*n*t+o*o,a=Math.sqrt(i);if(!Number.isInteger(a))return!1;const s=a+o;if(s%(2*n)!=0)return!1;const m=s/(2*n);return Number.isInteger(m)&&m>0},arity:x(2)}};const de={"recaman-seq":e=>function(e){if(1===e)return[0];const t=[0],r=new Set([0]);for(let n=1;n<e;n++){let e=t[n-1]-n;(e<=0||r.has(e))&&(e=t[n-1]+n),t.push(e),r.add(e)}return t}(e),"recaman-take-while":e=>{const t=[],r=new Set([0]);return O(e(0,0),n=>{if(!n)return t;return t.push(0),function n(o){let i=t[o-1]-o;return(i<=0||r.has(i))&&(i=t[o-1]+o),O(e(i,o),e=>e?(t.push(i),r.add(i),n(o+1)):t)}(1)})},"recaman?":()=>!0},qe={"thue-morse-seq":e=>{const t=[];for(let r=0;r<e;r+=1)t[r]=ve(r)%2;return t},"thue-morse-take-while":e=>{const t=[];return function r(n){const o=ve(n)%2;return O(e(o,n),e=>e?(t.push(o),r(n+1)):t)}(0)},"thue-morse?":e=>1===e||0===e};function ve(e){let t=0;for(;e;)t+=1&e,e>>=1;return t}const ke={};function we(e){for(const[t,r]of Object.entries(e)){if(ke[t])throw new Error(`Duplicate normal expression key found: ${t}`);ke[t]=r}}function xe(e,t){return{[`${e}-seq`]:Ne(e=>t.slice(0,e),t.length),[`${e}-take-while`]:Te(e=>function r(n){return n>=t.length?t.slice(0,n):O(e(t[n],n),e=>e?r(n+1):t.slice(0,n))}(0),t.length),[`${e}-nth`]:Ge(()=>t,t.length),[`${e}?`]:$e(e=>t.includes(e))}}function Ae(e){for(const[t,r]of Object.entries(e)){if(ke[t])throw new Error(`Duplicate normal expression key found: ${t}`);t.endsWith("seq")?(ke[t]=Ne(r,e.maxLength),e.noNth||(ke[t.replace(/seq$/,"nth")]=Ge(r,e.maxLength))):t.endsWith("take-while")?ke[t]=Te(r,e.maxLength):t.endsWith("?")&&(e.string?ke[t]=Ce(r):ke[t]=$e(r))}}function Ne(e,r){return{evaluate:(n,o)=>{const i=n[0]??r;l(i,o,{integer:!0,positive:!0,lte:r});const a=e(i,o);if("number"==typeof a[0]&&a.some(e=>e>Number.MAX_SAFE_INTEGER))throw new t("Result exceeds maximum safe integer",o);return a},arity:"number"==typeof r?{max:1}:x(1)}}function Te(e,r){return{evaluate:(r,n,o,{executeFunction:i})=>{const a=r[0];w(a,n);const s=e((e,t)=>O(i(a,[e,t],o),e=>!!e),n);return O(s,e=>{if("number"==typeof e[0]&&e.some(e=>e>Number.MAX_SAFE_INTEGER))throw new t("Result exceeds maximum safe integer",n);return e})},arity:"number"==typeof r?{max:1}:x(1)}}function Ge(e,r){return{evaluate:(n,o)=>{const i=n[0];l(i,o,{integer:!0,positive:!0,lte:r});const a=e(i,o);if("number"==typeof a[0]&&a.some(e=>e>Number.MAX_SAFE_INTEGER))throw new t("Result exceeds maximum safe integer",o);return a[i-1]},arity:x(1)}}function $e(e){return{evaluate:(t,r)=>{const n=t[0];return l(n,r),e(n,r)},arity:x(1)}}function Ce(e){return{evaluate:(t,r)=>{const n=t[0];return function(e,t,r={}){if(!function(e,t={}){return!("string"!=typeof e||t.nonEmpty&&0===e.length||t.char&&1!==e.length)}(e,r))throw f(r.nonEmpty?"non empty string":r.char?"character":"string",e,t)}(n,r),e(n,r)},arity:x(1)}}function We(e,t){for(;0!==t;){const r=t;t=e%t,e=r}return Math.abs(e)}function Me(e,t){return Math.floor(e*t/We(e,t))}function Se(e){if(1===e)return 1;const t=B(e);return new Set(t).size!==t.length?0:t.length%2==0?1:-1}function Ee(e,t){if(0===t)return[e,1,0];const[r,n,o]=Ee(t,e%t);return[r,o,n-Math.floor(e/t)*o]}function Re(e,t){const[r,n]=Ee(e,t);if(1!==r)throw new Error(`Modular inverse does not exist (gcd(${e}, ${t}) = ${r})`);return(n%t+t)%t}Ae(J),Ae({"collatz-seq":e=>{let t=e;const r=[t];for(;1!==t;)t%2==0?t/=2:t=3*t+1,r.push(t);return r},noNth:!0}),Ae(Y),Ae(te),Ae(ne),Ae(ae),Ae(se),Ae(ue),Ae(ce),Ae(le),Ae(ge),Ae(pe),Ae(be),Ae(Q),Ae(de),Ae(qe),we(xe("tribonacci",[0,1,1,2,4,7,13,24,44,81,149,274,504,927,1705,3136,5768,10609,19513,35890,66012,121415,223317,410744,755476,1389537,2555757,4700770,8646064,15902591,29249425,53798080,98950096,181997601,334745777,615693474,1132436852,2082876103,3831006429,7046319384,12960201916,23837527729,43844049029,80641778674,148323355432,272809183135,501774317241,922906855808,1697490356184,3122171529233,5742568741225,0x99b36012952,19426970897100,35731770264967,65720971788709,0x6df08059d9f8,0xca35cf00a924,408933139743937,752145307699165,0x4ea34736b35c2,0x90a3317d5c260,4680045560037375,8607945812375585])),we(xe("catalan",[1,2,5,14,42,132,429,1430,4862,16796,58786,208012,742900,2674440,9694845,35357670,129644790,477638700,1767263190,6564120420,24466267020,91482563640,343059613650,1289904147324,4861946401452,18367353072152,69533550916004,0xefe09af96cd8,0x38f88b34d6a68,0xd8db5c347b610])),we(xe("factorial",E)),we(xe("fibonacci",[0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368,75025,121393,196418,317811,514229,832040,1346269,2178309,3524578,5702887,9227465,14930352,24157817,39088169,63245986,102334155,165580141,267914296,433494437,701408733,1134903170,1836311903,2971215073,4807526976,7778742049,12586269025,20365011074,32951280099,53316291173,86267571272,139583862445,225851433717,365435296162,591286729879,956722026041,1548008755920,2504730781961,4052739537881,6557470319842,0x9a661ca20bb,0xf9d297a859d,27777890035288,44945570212853,72723460248141,0x6b04f4c2fe42,0xad2934c6d08f,308061521170129,498454011879264,806515533049393,0x4a2dce62b0d91,0x780626e057bc2,0xc233f54308953,5527939700884757,8944394323791464])),we(xe("lucas",[2,1,3,4,7,11,18,29,47,76,123,199,322,521,843,1364,2207,3571,5778,9349,15127,24476,39603,64079,103682,167761,271443,439204,710647,1149851,1860498,3010349,4870847,7881196,12752043,20633239,33385282,54018521,87403803,141422324,228826127,370248451,599074578,969323029,1568397607,2537720636,4106118243,6643838879,10749957122,17393796001,28143753123,45537549124,73681302247,119218851371,192900153618,312119004989,505019158607,817138163596,1322157322203,2139295485799,3461452808002,5600748293801,9062201101803,0xd55fbe3dc94,23725150497407,38388099893011,62113250390418,0x5b67cb4878a5,0x93e5a9822a37,0xef4d74caa2dc,425730551631123,688846502588399,0x3f5b3b1643d02,0x66834447bacf1,0xa5de7f5dfe9f3,4721424167835364,7639424778862807])),we(xe("mersenne",[3,7,31,127,2047,8191,131071,524287,2147483647])),we(xe("partition",z)),we(xe("pell",[1,2,5,12,29,70,169,408,985,2378,5741,13860,33461,80782,195025,470832,1136689,2744210,6625109,15994428,38613965,93222358,225058681,543339720,1311738121,3166815962,7645370045,18457556052,44560482149,107578520350,259717522849,627013566048,1513744654945,3654502875938,8822750406821,21300003689580,51422757785981,0x70e8e1937766,299713796309065,723573111879672,0x634c28af7f039,0xefb9b143d586a])),we(xe("perfect",[6,28,496,8128,33550336,8589869056,137438691328])),we(xe("sylvester",[2,6,42,1806,3263442,0x9afa8dc8416])),we(xe("bell",[1,2,5,15,52,203,877,4140,21147,115975,678570,4213597,27644437,190899322,1382958545,10480142147,82864869804,682076806159,5832742205057,51724158235372,474869816156751,4506715738447323])),we(U),we(H),we(re),we(fe);const Ie={"coprime?":{evaluate:([e,t],r)=>(l(e,r,{integer:!0}),l(t,r,{integer:!0}),1===We(e,t)),arity:x(2)},"divisible-by?":{evaluate:([e,t],r)=>(l(e,r,{integer:!0}),l(t,r,{integer:!0}),0!==t&&e%t===0),arity:x(2)},gcd:{evaluate:([e,t],r)=>(l(e,r),l(t,r),We(e,t)),arity:x(2)},lcm:{evaluate:([e,t],r)=>(l(e,r),l(t,r),Me(e,t)),arity:x(2)},multinomial:{evaluate:([...e],t)=>{g(e,t);return R(e.reduce((e,r)=>(l(r,t,{integer:!0,nonNegative:!0}),e+r),0))/e.reduce((e,t)=>e*R(t),1)},arity:{min:1}},"amicable?":{evaluate:([e,t],r)=>{l(e,r,{integer:!0,positive:!0}),l(t,r,{integer:!0,positive:!0});const n=M(e).reduce((e,t)=>e+t,0),o=M(t).reduce((e,t)=>e+t,0);return n===t&&o===e&&e!==t},arity:x(2)},"euler-totient":{evaluate:([e],t)=>{l(e,t,{integer:!0,positive:!0});let r=e;for(let t=2;t*t<=e;t+=1)if(e%t===0){for(;e%t===0;)e/=t;r-=r/t}return e>1&&(r-=r/e),r},arity:x(1)},mobius:{evaluate:([e],t)=>{if(l(e,t,{integer:!0,positive:!0}),1===e)return 1;const r=B(e);return new Set(r).size!==r.length?0:r.length%2==0?1:-1},arity:x(1)},mertens:{evaluate:([e],t)=>{if(l(e,t,{integer:!0,positive:!0}),1===e)return 1;let r=0;for(let t=1;t<=e;t++){r+=Se(t)}return r},arity:x(1)},sigma:{evaluate:([e],t)=>(l(e,t,{integer:!0,positive:!0}),W(e).reduce((e,t)=>e+t,0)),arity:x(1)},"carmichael-lambda":{evaluate:([e],t)=>{if(l(e,t,{integer:!0,positive:!0}),1===e)return 1;const r=B(e),n=new Map;for(const e of r)n.set(e,(n.get(e)||0)+1);const o=[];for(const[e,t]of n.entries())2===e?1===t?o.push(1):2===t?o.push(2):o.push(2**(t-2)):o.push((e-1)*e**(t-1));return o.reduce((e,t)=>Me(e,t),1)},arity:x(1)},"cartesian-product":{evaluate:(e,t)=>{e.forEach(e=>{d(e,t)});return e.reduce((e,t)=>{const r=[];return e.forEach(e=>{t.forEach(t=>{r.push([...e,t])})}),r},[[]])},arity:{min:1}},"perfect-power":{evaluate:([e],t)=>{l(e,t,{integer:!0,positive:!0});return ye(e)||null},arity:x(1)},"mod-exp":{evaluate:([e,t,r],n)=>(l(e,n,{finite:!0}),l(t,n,{integer:!0,positive:!0}),l(r,n,{integer:!0,positive:!0}),function(e,t,r){if(1===r)return 0;let n=1;for(e%=r;t>0;)t%2==1&&(n=n*e%r),t>>=1,e=e*e%r;return n}(e,t,r)),arity:x(3)},"mod-inv":{evaluate:([e,r],n)=>{l(e,n,{integer:!0,positive:!0}),l(r,n,{integer:!0,positive:!0});try{return Re(e,r)}catch(e){throw new t(e,n)}},arity:x(2)},"extended-gcd":{evaluate:([e,t],r)=>(l(e,r,{integer:!0}),l(t,r,{integer:!0}),Ee(e,t)),arity:x(2)},"chinese-remainder":{evaluate:([e,r],n)=>{if(g(e,n),g(r,n),e.length!==r.length)throw new t("Remainders and moduli must have the same length.",n);try{return function(e,t){for(let e=0;e<t.length;e++)for(let r=e+1;r<t.length;r++){const n=Ee(t[e],t[r])[0];if(1!==n)throw new Error(`Moduli must be pairwise coprime, but gcd(${t[e]}, ${t[r]}) = ${n}`)}const r=t.reduce((e,t)=>e*t,1);let n=0;for(let o=0;o<e.length;o++){const i=e[o],a=t[o],s=r/a;n=(n+i*s*Re(s,a))%r}return n}(e,r)}catch(e){throw new t(e.message,n)}},arity:x(2)},"stirling-first":{evaluate:([e,t],r)=>{l(e,r,{integer:!0,positive:!0}),l(t,r,{integer:!0,positive:!0,lte:e});const n=Array.from({length:e+1},()=>Array(t+1).fill(0));n[0][0]=1;for(let r=1;r<=e;r++)for(let e=1;e<=Math.min(r,t);e++)n[r][e]=n[r-1][e-1]+(r-1)*n[r-1][e];return n[e][t]},arity:x(2)},"stirling-second":{evaluate:([e,t],r)=>{if(l(e,r,{integer:!0,positive:!0}),l(t,r,{integer:!0,positive:!0,lte:e}),1===t)return 1;if(t===e)return 1;const n=Array.from({length:e+1},()=>Array(t+1).fill(0));n[0][0]=1;for(let r=1;r<=e;r++)for(let e=1;e<=Math.min(r,t);e++)n[r][e]=e*n[r-1][e]+n[r-1][e-1];return n[e][t]},arity:x(2)}};function ze(e){for(const[t,r]of Object.entries(e)){if(Ie[t])throw new Error(`Duplicate normal expression key found: ${t}`);Ie[t]=r}}!function(e){for(const[t,r]of Object.entries(e)){if(Ie[t])throw new Error(`Duplicate normal expression key found: ${t}`);Ie[t]=r}}(ke),ze(I),ze(S),ze(G),ze(D),ze(j),ze(L),ze($),ze(F);for(const[e,t]of Object.entries(A))Ie[e]&&(Ie[e].docs=t);const je={name:"number-theory",functions:Ie};exports.numberTheoryModule=je;
|
|
2
2
|
//# sourceMappingURL=number-theory.js.map
|