Aliquot sequence calculator
An aliquot sequence begins with a positive integer and repeatedly replaces the current term with the sum of its proper positive divisors.
Run — free
This calculator performs that iteration deterministically, reports every term it reaches, and stops when it uses the requested step limit, reaches zero, or detects a repeated value. A strict safe bound protects the calculation from unexpectedly large intermediate terms, making the result suitable for experiments, lessons, validation scripts, and reproducible number-theory workflows.
Choose the starting value and understand each transition
Enter a positive whole number as start and choose a step_limit from 1 through 100. The starting value is always the first item in the returned sequence. Each permitted transition then replaces the most recent term with its aliquot sum: the sum of every positive divisor smaller than the number itself. For example, the proper divisors of 12 are 1, 2, 3, 4, and 6, so the next term is 16. The proper divisors of 16 are 1, 2, 4, and 8, making the following term 15. Because the limit counts transitions rather than displayed values, a limit of ten can return at most eleven sequence entries. It may return fewer when a natural stopping condition appears. This convention keeps the requested computational effort unambiguous and makes it easy to compare the output with a hand calculation, classroom worksheet, database record, or another mathematical implementation. Aliases such as n, number, or value may supply the start in API integrations, while steps may supply the limit.
Read the termination and cycle information
The result includes the complete sequence produced during the request, the number of transitions actually completed, and a termination label. A label of step_limit means the calculator completed every requested transition without encountering an earlier stopping condition. A label of zero means the sequence reached zero; this commonly follows 1 because 1 has no proper positive divisors. A label of cycle means a newly calculated value was already present. The repeated value is included as the last sequence entry so the cycle is visible, and cycle_start_index identifies its earlier zero-based position. Perfect numbers therefore produce an immediate one-value loop: starting at 6 gives 6, 6 and points back to index zero. For non-cyclic results, cycle_start_index is -1, providing a stable response shape without a nullable field. Cycle detection avoids wasting the remaining step allowance on repetitions while preserving enough information to reconstruct the periodic portion and distinguish it from the nonrepeating lead-in.
Work safely with large terms and reproducible results
Every starting value must be no greater than the published safe bound of one trillion, and every generated term is checked against that same bound before it is accepted. If an intermediate aliquot sum exceeds the bound, the request returns an invalid-input error that names the transition where growth became unsafe. The calculator never truncates, rounds, or silently substitutes a smaller number, because doing so would create a sequence that is mathematically false. Internally, each aliquot sum is found by deterministic integer factorization and the multiplicative divisor-sum formula. There is no network access, random choice, current-time dependency, or stored state, so identical input produces identical output in the browser and through the API. Use a modest step limit when exploring an unfamiliar start, then increase it when the observed terms remain manageable. The API price is $0.002 per request. The item unit describes one requested calculation; the explicit term and step limits bound the work performed within it.
What you can do with it
Explore number-theory behavior
Follow a starting integer through successive proper-divisor sums and see whether it falls to zero, cycles, or continues.
Check teaching exercises
Compare a student or textbook sequence with a deterministic list that clearly states how many transitions were completed.
Test mathematical software
Use bounded, stable output as a reference when validating another aliquot-sequence implementation or data pipeline.
FAQ
What is an aliquot sequence?
It is a sequence in which each new term equals the sum of the previous term's proper positive divisors.
Does the step limit include the starting number?
No. It counts divisor-sum transitions, so a limit of ten can produce at most eleven displayed terms including the start.
Why can the sequence stop before the limit?
The calculator stops early when it reaches zero or generates a value that already appeared, because further terms would be zero or cyclic repetitions.
What happens when a term is too large?
The request fails with an invalid-input error instead of returning a partial or numerically unsafe sequence.
How much does an API request cost?
Each API request costs $0.002. The same deterministic logic can also run in the browser.
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/aliquot-sequence \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"start":12,"step_limit":10}'const res = await fetch("https://api.kit.forhosting.com/numth/aliquot-sequence", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"start": 12,
"step_limit": 10
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/numth/aliquot-sequence",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"start": 12,
"step_limit": 10
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/numth/aliquot-sequence", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"start":12,"step_limit":10}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"start":12,"step_limit":10}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/numth/aliquot-sequence", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"start": 12,
"step_limit": 10
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "numth.aliquot_sequence",
"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_term | 1000000000000 |
max_steps | 100 |
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. |