Abundancy index calculator
The divisors of 12 add up to 28, so its abundancy index is 28/12, reduced to 7/3: above 2, which makes 12 abundant. Enter any whole number from 1 and get the exact fraction and its class. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- N
- 12
- Sigma
- 28
- Numerator
- 7
- Denominator
- 3
- Fraction
- 7/3
The abundancy index of a positive integer n is the exact rational I(n) = sigma(n) divided by n, where sigma(n) is the sum of every positive divisor of n including one and n itself. Number theorists use this ratio to classify n as deficient when I(n) is less than two, perfect when I(n) equals two, and abundant when I(n) exceeds two, and they compare indices when studying friendly numbers, solitary numbers, and aliquot structure. This abundancy index calculator accepts a positive integer n, computes sigma(n) from the prime factorization, reduces sigma(n)/n by their greatest common divisor, and returns the fraction in lowest terms. Values of n below one are rejected as invalid input.
What the abundancy index is and why the exact fraction matters
The abundancy index I(n) of a positive integer n is the rational number sigma(n) divided by n, where sigma(n) denotes the sum of all positive divisors of n, including both one and n. The definition is classical: Euler already used the ratio when studying perfect numbers, and modern papers write I(n) whenever they need to compare how densely the divisors of n fill the interval up to n.
Because sigma is a multiplicative function, I is multiplicative as well: if a and b are coprime then I(ab) equals I(a) times I(b). That identity is why a prime p has index (p+1)/p, a prime power p^k has index (p^{k+1}−1)/((p−1)p^k), and a square-free product of distinct primes has a product of those simple fractions. Comparing I(n) with the integer two is exactly the perfect-number trichotomy: I(n) less than two means n is deficient, I(n) equal to two means n is perfect, and I(n) greater than two means n is abundant.
Twelve is the smallest abundant integer because sigma(12) is twenty-eight, so I(12) equals twenty-eight over twelve, which reduces to seven thirds. Six is the smallest perfect integer because sigma(6) is twelve and the reduced index is two over one. Ten is deficient because sigma(10) is eighteen and eighteen over ten reduces to nine fifths, which sits strictly below two.
Returning the reduced fraction, not a floating approximation, is the whole point of this tool. Friendly-number searches ask whether I(a) equals I(b) as rationals, and a decimal such as 2.333 conceals that twenty-eight twelfths and seven thirds are the same class. One has index one over one and is deficient; that edge case is accepted, not rejected.
Input contract, exact algorithm, and the response you get back
Internally the engine factors n by trial division, walking even powers of two first and then odd trial primes up to the square root of the remaining cofactor. For each prime power p^a it multiplies the integer geometric series one plus p plus p squared up to p^a to accumulate sigma(n).
It then computes g equal to the greatest common divisor of sigma(n) and n with the Euclidean algorithm and returns numerator equal to sigma(n) divided by g and denominator equal to n divided by g, together with the display string numerator slash denominator. The response also echoes n, the integer sigma, and a kind label that is deficient, perfect, or abundant according to whether sigma is less than, equal to, or greater than twice n.
All arithmetic stays in exact integers; there is no Date, no random draw, and no network call. Pair this page with a sum-of-divisors tool only when you want sigma(n) alone.
Where an abundancy index calculator earns its keep
Students meet the abundancy index when a textbook first defines deficient, perfect, and abundant numbers, because the comparison of I(n) with two is easier to remember than the equivalent test on sigma(n) and twice n. Contest writers and learning-management authors need an oracle that returns the exact reduced fraction so a grader can accept seven thirds and twenty-eight twelfths as the same answer after reduction, and so a learner who writes a rounded decimal is marked incomplete rather than lucky.
Researchers who hunt friendly numbers, solitary numbers, or integers with a prescribed abundancy require exact rational equality, not a float epsilon that quietly identifies 7/3 with a nearby impostor. Classroom notebooks can tabulate I(n) against n for the first few hundred integers without installing a computer-algebra system. Script authors who walk aliquot sequences often log the index next to the aliquot sum so a spike above two is visible before the sequence diverges.
What you can do with it
Classify deficient, perfect, and abundant integers
Compute I(n) as a reduced fraction and compare it with 2/1 to label homework sets, contest samples, or research tables without listing every divisor by hand.
Hunt friendly numbers with exact rational equality
Two integers are friendly when they share the same abundancy index. Compare the reduced numerator and denominator pairs instead of trusting a floating-point epsilon.
FAQ
What is the abundancy index of n?
I(n) is sigma(n) divided by n, where sigma(n) is the sum of all positive divisors of n.
How is the fraction reduced?
The engine computes g = gcd(sigma(n), n) with the Euclidean algorithm, then returns numerator = sigma(n)/g and denominator = n/g. Perfect numbers therefore come back as 2/1, not a bare 2.
What happens if n is below one?
The abundancy index is defined for positive integers; zero, negatives, and missing n are rejected and are not billed.
How do I tell deficient, perfect, and abundant from the index?
Compare I(n) with 2: less than 2 is deficient, equal to 2 is perfect, greater than 2 is abundant. The response also includes a kind label from the integer test sigma(n) versus 2n.
Why is the result a fraction and not a decimal?
Because checking whether two numbers share the same index needs exact values. A decimal such as 2.333 hides that 28/12 and 7/3 are the same value, while the reduced fraction shows it.
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/abundancy-index \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"n":12}'const res = await fetch("https://api.kit.forhosting.com/numth/abundancy-index", {
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/abundancy-index",
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/abundancy-index", 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/abundancy-index", 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.abundancy_index",
"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
The same deterministic arithmetic runs free in your browser and through the API at $0.002 per successful request, so homework checks and automated pipelines never disagree.
Input contract, exact algorithm, and the response you get back
Send a JSON body with the required field n, a positive whole number at least one and at most one trillion. The aliases number and value are accepted so a form, a spreadsheet export, or a query string can reuse one contract. Missing n, a non-integer, a fraction, scientific notation, or any value below one fails with invalid_input and is not billed; the error message names the field and the constraint so a client can highlight the control. Successful API calls cost $0.002 per item; failed validation does not consume balance. Keep n inside the published ceiling so trial division stays interactive on a Worker isolate.
Where an abundancy index calculator earns its keep
Pair this endpoint with a sum-of-divisors tool when you only need sigma(n), with an abundant-number checker when you only need the boolean and the abundance amount, and with an aliquot-sum calculator when you want proper divisors excluding n. This page answers the index question: the exact rational sigma(n) over n in lowest terms, rejected only when n is below one.
Integration use cases
Grade exact-fraction answers in LMS pipelines
Accept 7/3 and 28/12 as the same I(12) after reduction, reject n below one as invalid_input, and keep browser checks identical to the API oracle.
Technical questions
What does the abundancy index calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.