Unitary divisor sum calculator
The unitary divisors of 12 are 1, 3, 4 and 12, which add up to 20, while all its divisors add up to 28. Enter a positive whole number to get this sum with the prime powers behind it. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- N
- 12
- Unitary divisor sum
- 20
The unitary divisor sum, written sigma star of n, adds the positive divisors d for which d and n divided by d share no prime factor. It is related to the familiar sum-of-divisors function, but it answers a different number-theory question and usually produces a different result. Enter a positive integer to receive its unitary divisor sum and the prime-power factorization that supports the calculation. The algorithm is deterministic, runs without a network connection, and handles one as the empty-product base case.
What makes a divisor unitary
A positive divisor d of n is unitary when d is coprime to its complementary divisor n divided by d. In practical terms, every complete prime power in n must go entirely to one side of that pair. Consider 12, whose prime-power factorization is 2 squared times 3.
Its unitary divisors are 1, 3, 4, and 12: each chooses either all of the factor 4 or none of it, and independently either all of the factor 3 or none. The divisors 2 and 6 are ordinary divisors but not unitary, because each shares a factor 2 with its complement. Therefore the ordinary divisor sum of 12 is 28, while its unitary divisor sum is 20.
This calculator computes the latter quantity, commonly denoted by sigma star of n. The distinction matters in multiplicative number theory, studies of unitary perfect numbers, and any formula whose divisor relation requires coprime complementary factors rather than merely exact division.
How sigma star is calculated
Write the prime factorization of n as a product of complete prime powers p raised to a. For each prime power there are exactly two unitary choices: include the whole value p to the a, or include 1. Expanding all independent choices gives every unitary divisor once, so their sum is the product of the factors 1 plus p to the a.
The implementation first validates n, then performs deterministic trial division, records each prime, exponent, and complete power, and finally multiplies those short factors. For 72, the factorization is 2 cubed times 3 squared, so sigma star is (1 + 8)(1 + 9), which equals 90. For a prime q, the only unitary divisors are 1 and q, giving q + 1.
For n equal to 1, the factor list is empty and the product is 1.
Using the result safely
Send n as a positive whole number no greater than one trillion. JavaScript numbers remain exact throughout the declared range for the supported results, but the cap is also important for runtime because trial division can inspect candidates up to the square root of n. For much larger or cryptographic integers, use a dedicated arbitrary-precision factorization system.
This capability is intentionally focused on a transparent, bounded calculation rather than an unbounded factoring service.
What you can do with it
Study unitary perfect numbers
Compute sigma star values for candidate integers before comparing the result with twice the original number.
Check number-theory exercises
Verify a hand-derived prime-power product and clearly distinguish unitary divisors from all ordinary divisors.
Create deterministic sequence data
Generate reproducible sigma-star terms for bounded integer tables, automated tests, or exploratory notebooks.
FAQ
What is a unitary divisor?
A divisor d of n is unitary when d and n divided by d are coprime, so no prime factor is shared between the complementary divisors.
How is the unitary divisor sum different from the ordinary divisor sum?
The ordinary sum includes every positive divisor. Sigma star includes only unitary divisors, which must contain either an entire prime-power factor of n or none of it.
What formula does the calculator use?
If n is the product of prime powers p^a, the unitary divisor sum is the product of (1 + p^a) over those distinct prime powers.
What does the calculator return for one?
It returns 1. The factorization is empty, and the empty product used for sigma star of 1 equals 1.
What is the unitary divisor sum of 72?
It is 90. Since 72 is 2³ × 3², its full prime powers are 8 and 9, and the sum is the product (1 + 8) × (1 + 9), which equals 90.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/numth/unitary-divisor-sum \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"n":12}'const res = await fetch("https://api.kit.forhosting.com/numth/unitary-divisor-sum", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"n": 12
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/numth/unitary-divisor-sum",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"n": 12
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/numth/unitary-divisor-sum", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"n":12}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"n":12}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/numth/unitary-divisor-sum", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"n": 12
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "numth.unitary_divisor_sum",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_n | 1000000000000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
How sigma star is calculated
No divisor enumeration, random factor search, floating approximation, network request, or clock-dependent operation is involved, so repeated calls with the same accepted input return the same JSON result.
Using the result safely
The response returns n, unitary_divisor_sum, and factors in ascending prime order; every factor contains prime, exponent, and power fields. Inputs below one, missing values, fractions, nonnumeric text, and values beyond the published limit produce an invalid_input error instead of a misleading answer. A successful API request costs $0.002, while the browser version uses the same pure arithmetic locally.
Technical questions
What inputs cause an error?
A missing value, a value below 1, a fraction, nonnumeric text, or an integer above 1,000,000,000,000 returns invalid_input.
How much does an API request cost?
A successful API request costs $0.002. The browser calculator runs the same deterministic core locally.