Divisors[n]
gives a list of the integers that divide n.
Divisors
Divisors[n]
gives a list of the integers that divide n.
Details and Options
- Divisors[n,GaussianIntegers->True] includes divisors that are Gaussian integers.
Examples
open all close allBasic Examples (1)
Scope (2)
For integer input, integer divisors are returned:
Divisors[6]For Gaussian integer input, Gaussian divisors are produced:
Divisors[6 + 4I]Divisors threads element‐wise over list arguments:
Divisors[{605, 871, 824}]Options (3)
GaussianIntegers (3)
This will produce Gaussian divisors for integer input:
Divisors[2, GaussianIntegers -> True]Some primes are also Gaussian primes:
Divisors[3]Divisors[3, GaussianIntegers -> True]The ratio of Gaussian divisors to integer divisors:
ListPlot[Table[Length[Divisors[n, GaussianIntegers -> True]] / Length[Divisors[n]], {n, 200}], Filling -> Axis]Applications (3)
Find all perfect numbers less than 10000:
Select[Range[10 ^ 4 - 1], Total[Divisors[#]] == 2#&]Representation of 25 as sum of two squares:
{Re[#], Im[#]}& /@ Select[Divisors[25, GaussianIntegers -> True], Abs[#]^2 == 25&]PowersRepresentations generates an ordered representation:
PowersRepresentations[25, 2, 2]Number of representations of a number as a sum of four squares:
8 Total[Select[Divisors[20], !Divisible[#, 4]&]]Computation by SquaresR:
SquaresR[4, 20]Properties & Relations (4)
This counts the number of divisors:
Sum[1, {k, Divisors[2 ^ 12 - 1]}]DivisorSigma[0, 2 ^ 12 - 1]In general, DivisorSigma[d,n]==∑k|nkd:
Table[{DivisorSigma[d, 2 ^ 12 - 1], Sum[k ^ d, {k, Divisors[2 ^ 12 - 1]}]}, {d, 0, 5}]//GridSimilarly, EulerPhi[n]==n∏p|n(1-1/p) where p is prime:
100 Product[1 - 1 / k, {k, Select[Divisors[100], PrimeQ]}]EulerPhi[100]Alternatively, EulerPhi[n]==n∑k|nMoebiusMu[k]/k:
35 Sum[MoebiusMu[k] / k, {k, Divisors[35]}]EulerPhi[35]Possible Issues (1)
Divisors gives all divisors except for multiplication by units; that is, they lie in the first quadrant:
d = Divisors[2, GaussianIntegers -> True]Flatten[Outer[Times, {1, -1, I, -I}, d]]Divisible[2, %]See Also
FactorInteger EulerPhi Divisible DivisorSigma DivisorSum PerfectNumber
Function Repository: DivisorHasseDiagram
Tech Notes
Related Guides
Related Links
History
Introduced in 1988 (1.0)
Text
Wolfram Research (1988), Divisors, Wolfram Language function, https://reference.wolfram.com/language/ref/Divisors.html.
CMS
Wolfram Language. 1988. "Divisors." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Divisors.html.
APA
Wolfram Language. (1988). Divisors. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Divisors.html
BibTeX
@misc{reference.wolfram_2026_divisors, author="Wolfram Research", title="{Divisors}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/Divisors.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_divisors, organization={Wolfram Research}, title={Divisors}, year={1988}, url={https://reference.wolfram.com/language/ref/Divisors.html}, note=[Accessed: 13-June-2026]}