Divisors
All positive divisors of n, in increasing order.
DivisorMathWorldDivisorWikidataQ50708Encyclopedia of MathematicsDivisor_(of_an_integer_or_of_a_polynomial)Britannicatopic/divisorFungrim entry08ff0bWolfram LanguageDivisors!Rosetta CodeProper divisorsDivisors(n)all positive divisors of , increasing.enumeratio_divisors(n)SymPydivisors(n)Oscarsort(divisors(ZZ(n)))Juliasort(divisors(ZZ(n)))Divisors(n, Over -> GaussianIntegers)the first-quadrant divisors in , by real part then imaginaryTyped signatures
| Type | Package | Applies |
|---|---|---|
(integer) -> list<integer> | compute-engine | always |
(number | quadratic_integer, any*) -> list | number-theoryreplaces compute-engine | always |
Details
- Includes both 1 and itself; a prime's only divisors are those two.
- The count of divisors, , equals . See DivisorSigma.
- Highly composite numbers (like 720) pack unusually many divisors relative to their size.
- compute-engine only returns ordinary positive divisors.
- Threads element-wise over a list, as Wolfram's Listable heads do.
Examples
19 more kept as data, checked against the oraclesProperties #
A prime square has three divisors
live ↗Known value · Wolfram MathematicalFunctionData, Divisors
A prime contributes only the trivial divisors
live ↗Known value · Wolfram MathematicalFunctionData, Divisors
Product of two primes gives four divisors
live ↗Known value · Wolfram MathematicalFunctionData, Divisors
Six divisors, listed in increasing order
live ↗Known value · Wolfram MathematicalFunctionData, Divisors
: each subset of primes gives a divisor
live ↗Known value · Wolfram MathematicalFunctionData, Divisors
Possible issues #
About
| Examples | 49 |
|---|---|
| Checked against | Wolfram Language 48 agree1 differSageMath 37 agree1 differ1 errorSymPy 29 agree5 differ5 errormathlib4 22 agree1 differ6 errorOscar 24 agreeJulia 26 agree12 error |
| Crosswalk | WikipediaMathWorldWikidataEncyclopedia of MathematicsBritannicaFungrim entryWolfram LanguageSageMathSymPyOscarJuliaRosetta Code |
Implementation
oscarpackages/oracle/src/mappings.tssagepackages/oracle/src/mappings.tssympypackages/oracle/src/mappings.tsSymPy's divisors is over the integers (positive divisors of |n|); a Gaussian integer is not one, and the Over -> GaussianIntegers form has no counterpart.
juliapackages/oracle/src/mappings.tsmathlib4packages/oracle/src/mappings.tsNat.divisors sorted ascending into a list; natural n only, with divisors 0 = the empty list.
See also: FactorInteger, DivisorSigma