Practical number checker
Tells you whether every whole number below n can be built from distinct divisors of n: 12 is practical, since 1, 2, 3, 4, 6 and 12 reach every value from 1 to 12. If not, you see the first gap. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- N
- 12
- Divisors
- 1, 2, 3, 4, 6, 12
- Divisor count
- 6
- Divisor sum
- 28
The practical number checker answers a classical number-theory question: can every positive integer smaller than n be written as a sum of distinct positive divisors of n? The engine lists divisors by deterministic trial division, then runs a complete-sequence scan that never samples randomness, never calls the network, and never depends on the clock, so the same n always yields the same classification.
What a practical number is and what you get
A positive integer n is practical when every smaller positive integer can be expressed as a sum of distinct positive divisors of n. Because n itself is always a divisor, the same condition also covers every integer from one through n. The number one is practical by vacuity: there is no smaller positive integer to represent.
Two is practical because one is a divisor. Twelve is a standard example: its divisors one, two, three, four, six, and twelve can form every integer from one through twelve by distinct subsets. Ten is not practical: its divisors one, two, five, and ten can form one, two, three equals one plus two, five, six, seven, ten, and so on, but four has no representation, so four is the first unrepresentable value.
Odd integers greater than one are never practical, because two cannot be written as a sum of odd divisors. Perfect, abundant, and deficient labels answer a different question about the aliquot sum; a number can be practical without being abundant, and abundant without being practical.
How the inputs are read and how the complete-sequence scan stays exact
Optional leading plus signs are allowed for positive values; embedded spaces, hex prefixes, and exponential notation are rejected so a bad cell does not become a wrong flag. Negative integers and zero are rejected because practical numbers are defined here only on positive integers. The engine stays inside JavaScript safe integers, which is more than enough for classroom problems, programming contests, and most applied checks on moderately large n.
Internally every positive divisor is collected by trial division: walk d from one through the floor of the square root of n, and whenever d divides n record both d and n divided by d when those partners are distinct, then merge the halves into a single ascending list. The complete-sequence scan then maintains a reach value R meaning every integer from one through R is already a subset sum of the divisors processed so far.
For the next divisor d, if d is at most R plus one, the covered range extends to R plus d without gaps; if d exceeds R plus one, R plus one is the first unrepresentable integer and n is not practical. That procedure needs only modular checks and integer additions—never a floating-point step that could invent a false practical claim.
Where practical-number checks fit in study, research demos, and code
Students meet practical numbers when learning divisor sums, when exploring highly composite structure, and when reading about Egyptian fraction and coin-problem style representations that use the divisor set as denominations. Teachers can generate answer keys for worksheets without trusting opaque calculator apps that hide the subset-sum argument. Developers use the same contract to validate sample data for number-theory libraries, to gate property tests on random integer generators, or to pre-check that a seed sits in the practical class before a simulation step.
Contest practice often needs a fast offline source of practical-number answers so solutions can be checked without downloading OEIS tables. Pair it with the aliquot-sum and abundant checkers when you need abundance rather than representability, with a divisor-list tool when you only need the factors, and with prime-factorization helpers when you need the prime powers behind a single integer rather than the practical-number classification.
What you can do with it
Homework and contest classification
Classify integers as practical or not for worksheets and contest checks by reading the practical flag and the first gap without building subset sums by hand.
Teaching divisor subset sums
Show students how distinct divisors act like denominations while they change n live in the browser at no cost and see the first unrepresentable integer.
FAQ
What does the practical number checker cost?
It is free in your browser on this page.
What happens if n is below 1?
Practical numbers are defined here only for positive integers n ≥ 1.
How is the practical property decided?
The tool lists all positive divisors of n, then scans them as a complete sequence.
Is the algorithm randomized?
No. It uses deterministic trial division and integer arithmetic only. The same n always yields the same divisors, flag, and first gap when present.
How is this different from an abundant-number check?
Abundance compares the aliquot sum of proper divisors with n. Practicality asks whether every smaller positive integer is a sum of distinct divisors. The two classifications answer different questions.
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/practical-number-check \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"n":12}'const res = await fetch("https://api.kit.forhosting.com/numth/practical-number-check", {
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/practical-number-check",
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/practical-number-check", 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/practical-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": 12
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "numth.practical_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
Supply a positive integer n and the tool returns the full ascending divisor list, the divisor count and sum, a boolean practical flag, and—when the answer is false—the first positive integer that cannot be formed that way. Use it free in the browser for homework, contest prep, and OEIS-style exploration, or call the API at $0.002 per successful request when you automate classification pipelines, grading scripts, or teaching demos that need reproducible practical-number answers.
What a practical number is and what the response contains
This checker returns the parsed n, the sorted divisors array, divisor_count, divisor_sum (the sum-of-divisors function sigma(n)), practical true or false, and when practical is false the field first_unrepresentable with the smallest positive integer that cannot be formed. Missing fields, non-integers, fractions, scientific notation, values outside the safe integer range, and any n below one fail with invalid_input and a clear message.
How the inputs are read and how the complete-sequence scan stays exact
The preferred field is n as a JSON integer, but decimal strings and the aliases number or value are accepted so forms, spreadsheets, and query strings can reuse one contract.
Where practical-number checks fit in study, research demos, and code
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. That split—free interactive exploration and a priced, identical API—matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result.
Integration use cases
Deterministic test fixtures
Generate reproducible practical and non-practical cases for unit tests, property checks, and CI assertions without embedding static OEIS dumps.