跳到主要内容

斯特林数计算器

计算无符号第一类斯特林数 c(n,k) 和第二类斯特林数 S(n,k),使用任意精度算术,并显示两个三角形的周围行。

输入

输出

三角形的行 (围绕 n)
nc(n, 0..n) — first kindS(n, 0..n) — second kind
No data yet
分步解答
这对您有帮助吗?

使用此工具的更多方式

REST API

curl -X POST https://api.iotools.cloud/v1/tool/stirling-numbers-calculator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "n": "6",
    "k": "3"
  }'

替换成您账户中的密钥。工具的字段即为请求体——没有额外包装。

让 AI 代理执行

Use the IOTools `stirling-numbers-calculator` tool (Stirling Numbers Calculator) on this input:

YOUR_INPUT_HERE

将此粘贴给任何已连接 IOTools MCP 服务器的代理,再加上您的输入内容。

嵌入式小组件

<iframe
  src="https://iotools.cloud/embed/stirling-numbers-calculator/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="斯特林数计算器 — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

把它放到您自己的页面上——免费,无需密钥,只需保留一个反向链接。

每次 API/MCP 调用费用5 积分起
需要更多积分?查看定价

也可通过

使用指南

斯特林数计算器计算无符号第一类斯特林数 c(n, k) 和第二类斯特林数 S(n, k) — 使用任意精度精确计算,并显示两个三角形的周围行。

两类的含义

  • c(n, k) (无符号第一类斯特林数) — n 个元素中恰好有 k 个循环的排列数。
  • S(n, k) (第二类斯特林数) — 将 n 个元素的集合划分为恰好 k 个非空、无标签子集的方法数。

两者都是从相同类型的递推关系构建而来,一行一行地构建:

c(n, k) = c(n-1, k-1) + (n-1)·c(n-1, k)
S(n, k) = S(n-1, k-1) +    k·S(n-1, k)

基础情况为 c(0,0) = S(0,0) = 1,当 n > 0 时 c(n,0) = S(n,0) = 0。

如何使用

  1. 输入 n (集合大小) 和 k (循环数或子集数)。
  2. 读取 c(n, k)S(n, k) 这两个精确值。
  3. 查看三角形的行 (围绕 n),看每个值是如何逐行从第 0 行构建到第 n 行的。

如果 k 大于 n,两个值都是 0 — 无法将 n 个元素排列成超过元素数量的循环或子集。

为什么精确算术很重要

两类数都增长得极其迅速 — 例如 S(60, 30) 是一个 54 位整数。使用普通浮点数计算这些值的计算器会在 n 远未达到 20 时就无声地丧失精度 (Number.MAX_SAFE_INTEGER 只是 2⁵³ − 1)。此计算器始终使用 BigInt,因此每个值的每一位 — 无论 n 有多大 — 都是精确的。

隐私

此计算器完全在您的浏览器中运行。您的 n 和 k 值永远不会被上传、记录或存储。

stirling number first kindstirling number second kindcycles permutationset partitioncombinatoricsstirling triangleunsigned stirlingbell numbers

喜欢这些工具?去掉广告吧。

一次性付款即可永久移除您账户中的所有广告。无需订阅,不追踪。