Sum of Squared Divisors
Return σ₂(n), the exact sum of squares of all positive divisors, using prime-power products and trial division limited to n≤10¹².
Description
The divisor function σ₂(n) sums the squares of all positive divisors, including one and n.
The divisor function σ₂(n) sums the squares of all positive divisors, including one and n. Prime factorization turns the sum into a product of geometric sums.1
The tool returns value. The indexing and output conventions below determine how to read these values.
When to use Sum of Squared Divisors
Use this for the following task: Return σ₂(n), the exact sum of squares of all positive divisors, using prime-power products and trial division limited to n≤10¹². Use the input and output conventions below to reproduce the intended mathematical quantity.
How to use Sum of Squared Divisors and understand its results
- Choose the required indexes, integers or sequence entries. Preserve decimal-string encodings where the field table specifies strings.
- Enter n according to the field table, then run the tool.
- Read value. Preserve exact decimal strings and the stated indexing or coefficient order.
- Keep exact decimal strings for subsequent integer arithmetic; distinguish them from any explicitly approximate numeric result.
| Input field | Meaning | Value type and bounds | Requirement |
|---|---|---|---|
| n | Positive integer (trial-division resource limit 10^12) | integer; minimum 1; maximum 1000000000000 | Required |
Factor n and multiply exact BigInt geometric-series contributions. One returns the single-divisor sum one.
σ₂(n)=Π[p^a∥n](p^(2(a+1))−1)/(p²−1) The symbols and boundary conditions refer to the supplied fields and the implementation described above.
| Output field | Meaning | Value type |
|---|---|---|
| value | Sum of squared positive divisors | string (integer/arbitrary) |
{
"input": {
"n": 12
},
"output": {
"value": "210"
}
} Limitations and assumptions
The input is at most 10¹². The tool does not enumerate divisors or return the ordinary, unsquared divisor sum.
Use the declared integer bounds and string formats. Large exact outputs remain decimal strings; numerical approximations use ordinary floating-point arithmetic. A rejected input is different from a valid zero count or false membership flag.
Alternative or Complementary methods
Choose Abundancy Ratio when you need its operation: Compute the abundancy index σ(n)/n over all positive divisors, returning a reduced exact fraction and its floating-point value; trial division is limited to n≤10¹². Choose Distinct Prime Factor Count for the complementary operation: Return ω(n), the number of distinct prime factors, with ω(1)=0 and trial division limited to n≤10¹².
Background reference: Digital Library of Mathematical Functions, §27.2.
References
-
Digital Library of Mathematical Functions, §27.2 — National Institute of Standards and Technology
Similar or alternative tools
- Abundancy Ratio
Compute the abundancy index σ(n)/n over all positive divisors, returning a reduced exact fraction and its floating-point value; trial division is limited to n≤10¹².
- Distinct Prime Factor Count
Return ω(n), the number of distinct prime factors, with ω(1)=0 and trial division limited to n≤10¹².