Binomial coefficients row
Enter a row number and receive every binomial coefficient on that line of Pascal's triangle: row 5 gives 1, 5, 10, 10, 5, 1, six exact values that never lose digits as the numbers grow. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- N
- 5
- Coefficients
- 1, 5, 10, 10, 5, 1
- Quantity
- 6
A binomial coefficients row is one line of Pascal’s triangle: every value C(n,k) from n choose zero through n choose n, in order. This capability builds that full row for a single non-negative integer n using exact BigInt arithmetic, so coefficients never lose precision the way floating-point multiplications would. You send n; you receive the echo of n, the list of coefficients as decimal strings, and the count of entries (always n+1). Negative n is rejected before any work runs.
How the BigInt row is computed
Each entry is produced with the classic multiplicative recurrence: start from C(n,0) equals one, then form C(n,k) equals C(n,k-1) times (n−k+1) divided by k, using BigInt multiplication and exact integer division at every step. Because binomial coefficients are integers, the division has no remainder when the multiplications are ordered this way, so the algorithm never approximates. Complexity is linear in n: one multiply and one divide per column, with no need to compute full factorials that would overflow intermediate ranges.
Symmetry of the row is a consequence of the math, not a separate fill step—the recurrence walks from left to right and still lands on the correct palindrome. Prefer this path when you need the entire row rather than a single C(n,k): one call replaces n+1 separate choose calls and keeps all entries consistent with the same recurrence. If you only need one coefficient, you can still index into the returned array, but the design goal here is the full row for teaching, tables, and property-based checks.
Where binomial coefficient rows show up in practice
Educators and students generate Pascal rows to verify homework, illustrate induction, and compare against hand-written expansions of (x+y)^n without losing digits on large n. Software engineers use a trusted row as an oracle when testing their own choose implementations, combinadic rankers, or dynamic-programming tables that should reproduce C(n,k) for every k. Data and finance teams occasionally need binomial expansions for discrete probability models—binomial distributions, simple lattice path counts, or coefficient tables in reports—where an off-by-one or a float rounding error would silently corrupt a column.
Prefer this tool when the search intent is “give me the full binomial coefficients for row n,” not when you need multinomial coefficients, incomplete beta functions, or floating-point approximations.
What you can do with it
Homework and Pascal-triangle demos
Generate the exact row C(n,0)…C(n,n) for classroom checks and live demos without floating-point drift on larger n.
Binomial tables for models and reports
Export one Pascal row as decimal strings into a pipeline that builds probability tables or lattice-path counts.
FAQ
What does it cost?
The same row also runs free in your browser on this page.
Which values of n are accepted?
Non-negative integers from 0 up to the published maximum.
Why are coefficients returned as strings?
Central binomial coefficients exceed JavaScript safe integers for moderate n. Decimal strings preserve every digit of the exact BigInt value.
Does n equal zero work?
Yes. Row 0 is the single coefficient 1, matching C(0,0).
Is this the same as asking for one C(n,k)?
You can pick index k from the coefficients array if you only need one entry.
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/combo/binomial-row \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"n":5}'const res = await fetch("https://api.kit.forhosting.com/combo/binomial-row", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"n": 5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/combo/binomial-row",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"n": 5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/combo/binomial-row", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"n":5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"n":5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/combo/binomial-row", 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": 5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "combo.binomial_row",
"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
What the request and response look like
The response is a compact object with three fields. The count field equals coefficients.length and is always n+1, which is handy for quick assertions in tests. Send a JSON object with a single required field n: a non-negative whole number (zero is allowed and returns the one-element row [1]). The integer n is echoed so callers can pair results in fan-out jobs without re-reading the request. The coefficients array lists C(n,0), C(n,1), …, C(n,n) as decimal strings, not IEEE numbers, because central binomial coefficients outgrow Number.MAX_SAFE_INTEGER long before n becomes large. Missing n, fractional values, booleans, non-numeric strings, values above the published maximum, and any negative integer raise invalid_input with a message that names the field and the rule. That failure mode is intentional: a bad row index must not invent a Pascal row. Pricing is $0.002 per request on the API; the identical algorithm also runs free in your browser on this page when you only need an occasional row.
Where binomial coefficient rows show up in practice
Because the capability is tier A, you can paste n on this page and run the same Worker-grade BigInt logic free in the browser; automate later at $0.002 per item when scripts or SDKs need rows in bulk. Keep n a non-negative integer within the published bound, treat invalid_input as a client fix rather than a retry, and store coefficients as strings if you persist them so large central values survive JSON and spreadsheet imports intact.
Integration use cases
Oracle for combinatorics unit tests
Assert your local choose or DP table against a trusted full row so off-by-one bugs surface as coefficient mismatches.