Sociable numbers checker
The sociable numbers checker starts with one positive integer and repeatedly replaces it with the sum of its proper divisors.
Run — free
It records every term until the sequence reaches zero or repeats a value, then distinguishes a cycle that returns to the original starting number from a path that merely enters some other cycle. The result includes the full observed sequence, the repeated cycle, its length, and the number of iteration steps, making the calculation easy to inspect or reuse in a program.
What the checker means by a sociable cycle
An aliquot sum is the sum of all positive divisors of an integer except the integer itself. Starting from 12496, for example, the operation produces another integer; applying the same operation repeatedly eventually returns to 12496 after visiting several distinct terms. This checker calls that a sociable cycle because the repeated value is the original starting value. The response sets forms_sociable_cycle to true, labels the status as a sociable cycle, and returns the members in cycle order without duplicating the closing value inside the cycle array. The complete sequence does include that final repeated value so you can verify the closure directly. A perfect number therefore appears as a cycle of length one, and an amicable pair appears as a cycle of length two. Longer cycles are handled by exactly the same rule. This explicit convention avoids hiding mathematically related special cases and lets callers decide whether they want to filter for cycles of length three or greater. The reported step count is the number of aliquot transformations, not the number of distinct values stored.
How termination and other cycles are reported
Not every starting value belongs to a sociable cycle. If an iteration reaches 1, its next aliquot sum is 0 because 1 has no positive proper divisors. The checker then returns a terminated status, a false result, and a terminal value of zero. Another trajectory may merge into a cycle whose first member is not the requested starting value. In that case the response says that the path entered another cycle, identifies the index where that cycle begins, and returns only the repeating portion in the cycle field. These distinctions matter when exploring aliquot dynamics: merely reaching a repeated value proves eventual periodicity for the observed path, but it does not prove that the initial integer is a member of that period. The sequence array preserves the entire route from the supplied value through the closing repetition, so it can be plotted, audited, or compared with an independent divisor-sum implementation. Output fields that do not apply to a terminated path are omitted rather than filled with null values.
Safe bounds, deterministic calculation, and API use
Aliquot sequences can grow quickly, and factoring increasingly large terms can consume far more work than a small browser or edge calculation should accept. This capability therefore enforces a safe maximum term of 1,000,000,000 and a maximum of 1,000 transformations. The starting value must already be within the term bound. If any computed aliquot sum crosses it, the request fails with an invalid-input error that names the source term and the bound; it never returns a partial result that could be mistaken for a mathematical conclusion. A sequence that neither terminates nor repeats within the step limit also fails explicitly. Within those limits, the algorithm is deterministic: it enumerates divisor pairs up to the square root of each term, counts a square root only once, and uses no network access, clock, randomness, or stored state. Send the required start field as a positive integer. The same input always produces the same JSON result, whether you use the browser tool or automate checks through the API at $0.002 per request.
What you can do with it
Explore a known sociable number
Confirm the full cycle, its length, and the exact aliquot transition that closes it.
Classify an aliquot trajectory
Distinguish termination at zero from membership in the starting cycle or entry into another repeated cycle.
Validate number-theory code
Compare a deterministic sequence and cycle boundary with the output of an independent proper-divisor implementation.
FAQ
What is an aliquot sum?
It is the sum of every positive divisor of a number except the number itself. For 6, the proper divisors 1, 2, and 3 sum to 6.
Do perfect numbers and amicable pairs count?
Yes. This checker treats a perfect number as a returning cycle of length one and an amicable pair as a returning cycle of length two.
Why does the sequence repeat its last value?
The final repeated value visibly proves where the trajectory closes. The separate cycle array lists each cycle member only once.
What happens when a generated term is too large?
The request returns an invalid-input error as soon as a term exceeds the safe bound, instead of presenting an incomplete classification.
How much does an API check cost?
Each API request costs $0.002. The browser version uses the same deterministic calculation.
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/sociable-numbers \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"start":12496}'const res = await fetch("https://api.kit.forhosting.com/numth/sociable-numbers", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"start": 12496
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/numth/sociable-numbers",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"start": 12496
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/numth/sociable-numbers", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"start":12496}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"start":12496}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/numth/sociable-numbers", 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": 12496
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "numth.sociable_numbers",
"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 | 1000000000 |
max_steps | 1000 |
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. |