Perfect number checker
Check whether a number equals the sum of its proper divisors: 28 is perfect because 1, 2, 4, 7 and 14 add up to 28. You also see the divisors, their sum and the prime factorization. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- N
- 28
- Proper divisor sum
- 28
- Proper divisors
- 1, 2, 4, 7, 14
A perfect number equals the sum of its proper divisors—every positive divisor of n except n itself. Six is perfect because one plus two plus three equals six; twenty-eight is perfect because one plus two plus four plus seven plus fourteen equals twenty-eight; twelve is not perfect because its proper divisors sum to sixteen. The arithmetic is fully deterministic: no network calls, no randomness, and no clock.
What a perfect number is and how the check is decided
Proper divisors of a positive integer n are the positive integers that divide n exactly and are strictly smaller than n. Their sum is the aliquot sum s(n). Equivalently, if sigma(n) denotes the sum of all positive divisors including n, then s(n) equals sigma(n) minus n.
The classical definition, used since Euclid and Nicomachus, says n is perfect when s(n) equals n, deficient when s(n) is less than n, and abundant when s(n) exceeds n. One is not perfect because its set of proper divisors is empty and the sum is zero. Every prime p has proper-divisor sum one, so primes are never perfect.
Even perfect numbers are tightly linked to Mersenne primes through the Euclid–Euler form two to the power of p minus one times two to the power of p minus one, when two to the power of p minus one is prime: six, twenty-eight, four hundred ninety-six, and eight thousand one hundred twenty-eight are the first familiar examples.
Where perfect-number checks fit in study, contests, and automation
Students meet perfect numbers when learning divisors, abundance classes, and early number theory history. Teachers can generate answer keys for worksheets that ask whether six, twenty-eight, or four hundred ninety-six is perfect, and can contrast them with twelve or eighteen without trusting opaque calculator apps. Developers use the same contract to validate sample data for number-theory libraries, to gate property tests that assert known perfect seeds, or to pre-check that a demo integer really is perfect before a live classroom step.
Contest practice often needs a fast offline source of perfect-membership so solutions can be checked without hard-coding OEIS lists. Data pipelines that normalize catalog puzzles or recreational-math content sometimes need to reject non-perfect seeds before a step that assumes an equality of divisor sum and value. Keep n within the published limit so trial division stays interactive; for cryptographic-size integers you need a dedicated multiprecision factoring stack, not this lightweight parse capability.
What you can do with it
Contest and CTF perfect-number checks
Verify perfect membership quickly while solving programming contest or capture-the-flag problems that mention perfect numbers without embedding static tables.
Teaching Euclid–Euler even perfect numbers
Demonstrate that six, twenty-eight, four hundred ninety-six, and eight thousand one hundred twenty-eight pass the proper-divisor equality while nearby composites fail.
FAQ
What is a perfect number?
A positive integer equal to the sum of its proper divisors (all positive divisors except itself). Six is perfect because 1 + 2 + 3 = 6; twenty-eight is perfect because 1 + 2 + 4 + 7 + 14 = 28.
How does this differ from an aliquot-sum calculator?
An aliquot-sum tool returns s(n) and may also label deficient or abundant; people searching for a perfect number checker land here.
Is the perfect number checker free?
The browser tool is free and runs locally.
Is the algorithm randomized?
No. It uses deterministic trial-division factorization and exact integer equality of the proper-divisor sum with n.
Is 28 a perfect number?
Yes. Its proper divisors are 1, 2, 4, 7 and 14, and they add up to exactly 28. The checker also shows that 28 is 2 squared times 7.
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/perfect-number-check \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"n":28}'const res = await fetch("https://api.kit.forhosting.com/numth/perfect-number-check", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"n": 28
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/numth/perfect-number-check",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"n": 28
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/numth/perfect-number-check", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"n":28}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"n":28}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/numth/perfect-number-check", 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": 28
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "numth.perfect_number_check",
"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.
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
This capability factors a positive integer n, builds the ordered list of proper divisors, totals them, and returns a clear is_perfect flag together with the sum and factorization so every step is auditable. Explore free in your browser for homework, contest prep, and teaching demos, or call the API at $0.002 per successful request when grading scripts and recreational number-theory pipelines need the same yes-or-no perfect-number verdict without installing a computer-algebra system.
What a perfect number is and how the check is decided
This checker answers only the perfect-membership question: is_perfect is true exactly when the proper-divisor sum equals n, and false otherwise. This tool never approximates or samples candidates: it factors n once with trial division, multiplies the geometric series for each prime power to obtain sigma(n), subtracts n, lists the proper divisors from the same factorization, and sets the boolean by exact integer equality so textbook answers and API answers never disagree.
How to call the API and what comes back
Use it from homework pipelines, CTF write-ups, perfect-number drills, or any workflow that needs a reproducible yes-or-no perfect check without reimplementing factorization on every machine. Send a JSON body with a single required field n—a positive whole number at least one and at most one trillion (ten to the twelfth). Aliases number and value are accepted for the same field so forms and query strings can reuse one contract. On success the response includes n as accepted, is_perfect as a boolean, proper_divisor_sum as the aliquot total, proper_divisors as the ascending list of those divisors, and factors as an ordered list of objects each with prime and exponent. Failed validation—missing n, a non-integer, a fraction, a value below one, or a value above the published limit—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request (unit item with zero marginal unit price). Non-perfect integers still return a successful response with is_perfect false; only domain violations are errors, which keeps grading scripts simple when students submit abundant or deficient candidates.
Where perfect-number checks fit in study, contests, and automation
On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. Sibling search traffic for the full three-way abundance label is served by a separate aliquot-sum landing—this page targets people who specifically want a perfect-number checker and a clear is_perfect flag.
Integration use cases
Homework: is this integer perfect?
Give students an integer and check their hand-computed proper-divisor sum and perfect yes/no against a deterministic API or free browser result.
Technical questions
What inputs are rejected?
Missing n, non-integers, values below 1, and values above 10^12 return invalid_input. Those failures are not charged. Non-perfect integers still succeed with is_perfect false.