{"uid":"cap_FVvWr31tjjDtUHF-qvQMn","slug":"agent402-tools-combinatorics-calculator-3056c540","name":"agent402.tools Combinatorics Calculator","description":"Compute combinations C(n, r) or permutations P(n, r) using BigInt for exact arbitrary-precision results. Returns the result as a string (since values can exceed Number.MAX_SAFE_INTEGER) and a human-readable formula.","url":"https://agent402.tools/api/combinatorics","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"n":{"type":"integer","description":"Total items (0 to 1000)"},"r":{"type":"integer","description":"Items chosen (0 to n)"},"type":{"type":"string","description":"\"combination\" (default) or \"permutation\""}}},"responseSchema":{"type":"json","example":{"n":10,"r":3,"type":"combination","result":"120","formula":"C(10,3) = 10! / (3! × 7!)"}},"example":{"request":{"n":49,"r":6,"type":"combination"},"response":{"n":49,"r":6,"type":"combination","result":"13983816","formula":"C(49,6) = 49! / (6! × 43!)"}},"exampleRequest":{"n":49,"r":6,"type":"combination"},"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_WKYe94rg9aHlx_XmlTJnQ","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes exact combinations C(n,r) or permutations P(n,r) using arbitrary-precision BigInt arithmetic, returning the result as a string and human-readable formula","exampleAgentPrompt":"How many ways can I choose 6 numbers from a pool of 49? Calculate the combination C(49, 6) and give me the exact result.","exampleUseCases":null,"resultDescription":"Returns a JSON object containing the exact numeric result as a string (to handle values beyond Number.MAX_SAFE_INTEGER), the computation type (combination or permutation), and a human-readable formula like C(49,6) = 13,983,816","failureModes":["r > n returns an error (invalid selection size)","n or r outside 0–1000 range returns a validation error","invalid type string (not 'combination' or 'permutation') returns a bad request error","missing required parameters n or r returns a 400 error","payment not included or insufficient returns 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when you need exact, arbitrary-precision combinatorics results that would overflow JavaScript's Number.MAX_SAFE_INTEGER — particularly for large n values (e.g. n > 60) where floating-point approximations would lose precision. Prefer over manual factorial computation or math libraries when you need a reliable, hosted solution with BigInt guarantees.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T19:14:03.630Z","isFirstParty":false}