Skip to content

DivisorSigma ​

The sum of the kth powers of the divisors of n.

✓ checked against that system · ! checked, with disagreements (hover a chip)WikipediaDivisor functionMathWorldDivisorFunctionWikidataQ915474DLMF27.2.E1027.2.E927.2.i.p4FungrimDivisorSigmaFungrim entry7c00e6Wolfram LanguageDivisorSigma!
DivisorSigma(k, n)sum of the kkth powers of the divisors of nn.
SageMathsigma(n, k)SymPydivisor_sigma(n, k)Juliadivisor_sigma(ZZ(n), Int(k))
Typed signatures
TypePackageApplies
(integer, integer) -> integercompute-enginealways
(number, number, any*) -> numbernumber-theoryreplaces compute-enginealways

Domain: Number theory

Details
  • k=0k=0 gives the divisor count d(n)d(n); k=1k=1 gives the ordinary sum of divisors.
  • Multiplicative: σk(mn)=σk(m)σk(n)\sigma_k(mn)=\sigma_k(m)\sigma_k(n) whenever gcd⁡(m,n)=1\gcd(m,n)=1.
  • A perfect number nn satisfies σ1(n)=2n\sigma_1(n)=2n, as with 6 and 28.
  • A negative order sums reciprocal powers: σ−k(n)=σk(n)/nk\sigma_{-k}(n) = \sigma_k(n)/n^k.

Plot

Examples

Basic #

k = 0 gives the number of divisors

live ↗
InDivisorSigma(0,20)\mathrm{DivisorSigma}(0, 20)Out66

k = 1 gives the sum of divisors

live ↗
InDivisorSigma(1,20)\mathrm{DivisorSigma}(1, 20)Out4242
live ↗
InDivisorSigma(2,20)\mathrm{DivisorSigma}(2, 20)Out546546
live ↗
InDivisorSigma(2,6)\mathrm{DivisorSigma}(2, 6)Out5050
Scope #

A negative order sums reciprocal powers: σ−1(6)=1+12+13+16=2\sigma_{-1}(6) = 1 + \frac12 + \frac13 + \frac16 = 2

live ↗
InDivisorSigma(−1,6)\mathrm{DivisorSigma}(-1, 6)Out22

Large integers

live ↗
InDivisorSigma(2,1030)\mathrm{DivisorSigma}(2, 10^{30})Out1 388 888 888 888 888 888 587 721 618 754 026 546 109 040 824 596 043 713 112 4511\,388\,888\,888\,888\,888\,888\,587\,721\,618\,754\,026\,546\,109\,040\,824\,596\,043\,713\,112\,451

Negative kk: 1+14+125+11001+\tfrac14+\tfrac1{25}+\tfrac1{100}

live ↗
InDivisorSigma(−2,10)\mathrm{DivisorSigma}(-2, 10)Out1310\frac{13}{10}

Rational kk: the square roots of the divisors of 12, summed

live ↗
InDivisorSigma(12,12)\mathrm{DivisorSigma}(\frac{1}{2}, 12)Out3+2+6+333+\sqrt{2}+\sqrt{6}+3\sqrt{3}

Gaussian integers: 1+(1+i)+(1+2i)+(3+i)1+(1+i)+(1+2i)+(3+i), over Divisors

live ↗
InDivisorSigma(1,3+i)\mathrm{DivisorSigma}(1, 3+i)Out6+4i6+4i

GaussianIntegers -> True: squares of 1,1+i,2,3,3+3i,61,1+i,2,3,3+3i,6

live ↗
InDivisorSigma(2,6,Rule(Over,GaussianIntegers))\mathrm{DivisorSigma}(2, 6, \mathrm{Rule}(\mathrm{Over}, \mathrm{GaussianIntegers}))Out50+20i50+20i

Listable in nn

live ↗
InDivisorSigma(2,[1,2,3,4,5])\mathrm{DivisorSigma}(2, \bigl\lbrack1, 2, 3, 4, 5\bigr\rbrack)Out[1,5,10,21,26]\bigl\lbrack1, 5, 10, 21, 26\bigr\rbrack

Symbolic kk expands over the divisors

live ↗
InDivisorSigma(k,30)\mathrm{DivisorSigma}(k, 30)Out2k+3k+5k+6k+10k+15k+30k+12^{k}+3^{k}+5^{k}+6^{k}+10^{k}+15^{k}+30^{k}+1

A negative nn takes its sign off: σ1(−12)=σ1(12)=28\sigma_1(-12)=\sigma_1(12)=28, as in Wolfram

live ↗
InDivisorSigma(1,−12)\mathrm{DivisorSigma}(1, -12)Out2828

Likewise for k=0k=0: the 6 divisors of ∣n∣|n|

live ↗
InDivisorSigma(0,−12)\mathrm{DivisorSigma}(0, -12)Out66
Applications #

6 is a perfect number: σ1(6)=2×6\sigma_1(6)=2\times6

live ↗
InDivisorSigma(1,6)\mathrm{DivisorSigma}(1, 6)Out1212

28 is the next perfect number: σ1(28)=2×28\sigma_1(28)=2\times28

live ↗
InDivisorSigma(1,28)\mathrm{DivisorSigma}(1, 28)Out5656

Perfect numbers have σ(n)=2n\sigma(n)=2n

live ↗
InFilter(1..30,_1⁡↦DivisorSigma(1,_1⁡)=2_1⁡)\mathrm{Filter}(1..30, \operatorname{\_1}↦\mathrm{DivisorSigma}(1, \operatorname{\_1})=2\operatorname{\_1})Out[6,28]\bigl\lbrack6, 28\bigr\rbrack

Deficient numbers, where σ(n)<2n\sigma(n)<2n

live ↗
InFilter(1..30,_1⁡↦DivisorSigma(1,_1⁡)<2_1⁡)\mathrm{Filter}(1..30, \operatorname{\_1}↦\mathrm{DivisorSigma}(1, \operatorname{\_1})\lt2\operatorname{\_1})Out[1,2,3,4,5,7,8,9,10,11,13,14,15,16,17,19,21,22,23,25,26,27,29]\bigl\lbrack1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 19, 21, 22, 23, 25, 26, 27, 29\bigr\rbrack

Abundant numbers, where σ(n)>2n\sigma(n)>2n

live ↗
InFilter(1..30,_1⁡↦2_1⁡<DivisorSigma(1,_1⁡))\mathrm{Filter}(1..30, \operatorname{\_1}↦2\operatorname{\_1}\lt\mathrm{DivisorSigma}(1, \operatorname{\_1}))Out[12,18,20,24,30]\bigl\lbrack12, 18, 20, 24, 30\bigr\rbrack

Iterating the aliquot map from 276, a long-running sequence

live ↗
InNestList(_1⁡↦DivisorSigma(1,_1⁡)−_1⁡,276,20)\mathrm{NestList}(\operatorname{\_1}↦\mathrm{DivisorSigma}(1, \operatorname{\_1})-\operatorname{\_1}, 276, 20)Out[276,396,696,1 104,1 872,3 770,3 790,3 050,2 716,2 772,5 964,10 164,19 628,19 684,22 876,26 404,30 044,33 796,38 780,54 628,54 684]\bigl\lbrack276, 396, 696, 1\,104, 1\,872, 3\,770, 3\,790, 3\,050, 2\,716, 2\,772, 5\,964, 10\,164, 19\,628, 19\,684, 22\,876, 26\,404, 30\,044, 33\,796, 38\,780, 54\,628, 54\,684\bigr\rbrack
live ↗
In(_1⁡↦DivisorSigma(0,_1⁡))([2,3,5,6,7,8,10])(\operatorname{\_1}↦\mathrm{DivisorSigma}(0, \operatorname{\_1}))(\bigl\lbrack2, 3, 5, 6, 7, 8, 10\bigr\rbrack)Out[2,2,2,4,2,4,4]\bigl\lbrack2, 2, 2, 4, 2, 4, 4\bigr\rbrack
live ↗
In(_1⁡↦DivisorSigma(0,_1⁡))([1,4,9])(\operatorname{\_1}↦\mathrm{DivisorSigma}(0, \operatorname{\_1}))(\bigl\lbrack1, 4, 9\bigr\rbrack)Out[1,3,3]\bigl\lbrack1, 3, 3\bigr\rbrack
Properties #

Multiplicative: σ1(mn)=σ1(m)σ1(n)\sigma_1(mn)=\sigma_1(m)\sigma_1(n) when gcd⁡(m,n)=1\gcd(m,n)=1, here for 99 and 88

live ↗
InDivisorSigma(1,9)DivisorSigma(1,8)=DivisorSigma(1,72)\mathrm{DivisorSigma}(1, 9)\mathrm{DivisorSigma}(1, 8)=\mathrm{DivisorSigma}(1, 72)OutTrue\mathrm{True}

Sum of fifth powers of the divisors of 100

live ↗
InDivisorSigma(5,100)\mathrm{DivisorSigma}(5, 100)Out10 325 569 80710\,325\,569\,807

Multiplicative: coprime arguments multiply

live ↗
InDivisorSigma(3,18)DivisorSigma(3,25)=DivisorSigma(3,450)\mathrm{DivisorSigma}(3, 18)\mathrm{DivisorSigma}(3, 25)=\mathrm{DivisorSigma}(3, 450)OutTrue\mathrm{True}

σ−1(n)=σ(n)/n\sigma_{-1}(n)=\sigma(n)/n, which is 2 for a perfect number

live ↗
InDivisorSigma(−1,28)\mathrm{DivisorSigma}(-1, 28)Out22

σ0\sigma_0 counts divisors; 1 has one

live ↗
InDivisorSigma(0,1)\mathrm{DivisorSigma}(0, 1)Out11

Known value · Wolfram MathematicalFunctionData, DivisorSigma

A prime has two divisors

live ↗
InDivisorSigma(0,2)\mathrm{DivisorSigma}(0, 2)Out22

Known value · Wolfram MathematicalFunctionData, DivisorSigma

Another prime, two divisors

live ↗
InDivisorSigma(0,3)\mathrm{DivisorSigma}(0, 3)Out22

Known value · Wolfram MathematicalFunctionData, DivisorSigma

Every prime power is deficient

live ↗
InMap(_1⁡↦DivisorSigma(1,_1⁡)<2_1⁡,Filter(1..100,IsPrimePower))\mathrm{Map}(\operatorname{\_1}↦\mathrm{DivisorSigma}(1, \operatorname{\_1})\lt2\operatorname{\_1}, \mathrm{Filter}(1..100, \mathrm{IsPrimePower}))Out[True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True]\bigl\lbrack\mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}, \mathrm{True}\bigr\rbrack
Possible issues #

The trivial base case

live ↗
InDivisorSigma(1,1)\mathrm{DivisorSigma}(1, 1)Out11
About
Examples31
Checked againstWolfram Language 29 agree2 differSageMath 17 agree6 errorSymPy 15 agree8 errormathlib4 14 agree8 errorJulia 15 agree7 error
CrosswalkWikipediaMathWorldWikidataDLMF ×3FungrimFungrim entryWolfram LanguageSageMathSymPyJulia

Implementation

mappedsympypackages/oracle/src/mappings.ts

SymPy's divisor_sigma takes (n, k), the reverse of our (k, n).

mappedsagepackages/oracle/src/mappings.ts
mappedjuliapackages/oracle/src/mappings.ts
mappedmathlib4packages/oracle/src/mappings.ts

ArithmeticFunction.sigma k n = the sum of the kth powers of the divisors of n, with sigma k 0 = 0; natural k and n only.

See also: Divisors