ForHosting KIT · Math

Divisors of a number

12 has 6 divisors, 1, 2, 3, 4, 6 and 12, and they add up to 28. Enter any positive whole number up to one trillion and get the full ordered list, the count and the sum in one answer. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
N
12
You get
Divisors
1, 2, 3, 4, 6, 12
Quantity
6
Sum
28

Finding the positive divisors of an integer is a foundational number-theory task: it underpins factorization checks, perfect-number tests, aliquot sequences, and classroom exercises that ask for both the list and the sum of divisors. This capability takes a single positive integer n and returns every divisor in ascending order, the total how many there are, and their arithmetic sum, so you do not have to re-derive the walk from one through the square root yourself.

What a positive divisor list really means

A positive divisor of an integer n is any positive integer d such that n divides evenly by d with no remainder. By definition every positive integer has at least the pair one and itself; primes have exactly those two, while highly composite values fan out into longer ascending sequences. Textbooks often ask not only for the set of divisors but also for how many there are (the divisor function d(n) or tau(n)) and for their sum (the sum-of-divisors function sigma(n)).

Those two aggregates appear in perfect-number definitions, abundance and deficiency classification, and many contest problems that never need the full factorization of n. Computing the list by hand for a large n is tedious and easy to miss a middle factor; automating the enumeration keeps the result complete, ordered, and ready for the next step in a pipeline or homework check.

How the capability computes the answer

The engine walks candidate divisors from one up through the integer square root of n. Whenever a candidate divides n evenly it records both that candidate and the complementary quotient, avoiding double-counting perfect squares when the two values coincide. After the scan finishes, the complementary factors are reversed and concatenated so the full list is strictly ascending without a separate sort of the entire set.

The response then reports n itself, the ordered array of divisors, the length of that array as count, and the sum of every entry.

Where to use it and what it costs

Typical placements include validating student answers that list divisors, pre-filtering candidates before a full factorization pass, computing sigma(n) for aliquot or perfect-number experiments, and documenting the divisor structure of configuration sizes such as page counts or batch sizes. The browser path runs locally and needs no account. Keep n inside the documented bounds so the square-root walk stays predictable, and treat the returned count and sum as first-class fields rather than re-deriving them from the array in client code that might drift from this contract.

Homework and contest checks

Verify a student’s divisor list, count, and sum for a given n against a single canonical response instead of grading three separate manual calculations.

Pipeline metadata for integer sizes

Record every divisor of a batch size or page count so downstream steps can split work evenly only along true factors of the total.

What happens if n is zero or negative?

Only positive integers starting at 1 are accepted, matching the mathematical definition of positive divisors used here.

Does the response include one and n itself?

Yes. Every positive integer has at least the divisors 1 and n; primes return exactly those two values.

What are the divisors of 12?

They are 1, 2, 3, 4, 6 and 12. That makes 6 divisors in total, and their sum is 28, which is more than twice 12.

How large a number can I enter?

Any positive whole number up to one trillion. Larger values, zero, negatives and decimals are refused with a clear message instead of returning an incomplete list.

How many divisors does a prime number have?

Exactly two: 1 and the prime itself. If the list for your number shows only those two entries, the number is prime.

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.

POSThttps://api.kit.forhosting.com/numth/divisor-list

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.

curl -X POST https://api.kit.forhosting.com/numth/divisor-list \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"n":12}'
{
  "n": 12
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "numth.divisor_list",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

How the capability computes the answer

You send a JSON body with a single required field n, a positive integer at least one and at most one trillion. Invalid input—missing n, a non-integer, zero, a negative value, or a number above the published ceiling—fails with invalid_input and is never charged. There is no randomness, no clock dependency, and no network call; two identical requests always produce the same JSON.

Where to use it and what it costs

Use the free browser tool when you want a quick check for a single value, or call the API when a script, gradebook, or data job must resolve many integers the same way every time. API usage draws from prepaid KIT balance at the published $0.002 base price per successful request; failed validation does not consume balance.

Perfect and abundant number screens

Feed successive integers through the API and compare sum against 2n to classify deficient, perfect, or abundant numbers without writing your own sigma routine.

How do I list the divisors of a number with this API?

POST a JSON body with the positive integer field n. The response includes divisors in ascending order, count, and sum.

Is the divisor list tool free?

The browser widget is free and runs locally. API calls use prepaid KIT balance at the published $0.002 base price; invalid input is not charged.

Is the result always the same for the same n?

Yes. The algorithm is pure trial division with no randomness or timestamps, so identical inputs produce identical JSON.

Read the full KIT documentation →