跳到主要内容

资源 · 指南或文章

Integer Partition

定义整数拆分,即把 n 写成若干数之和且不计顺序的方式,并与有序拆分(composition)作对比。

审核日期

打开原站: Integer Partition (在新标签页中打开原网站)

添加到路线图

把这个资源放进你正在跟进的路线图。它会作为你自己的补充资源显示;路线图的步骤不会改变,也不计入你已记录的步骤。

来源内容语言:英语

In number theory and combinatorics, a partition of a positive integer n, also called an integer partition, is a way of writing n as a sum of positive integers. Two sums that differ only in the order of their summands are considered the same partition. For example, 4 can be partitioned in five distinct ways: The order-dependent composition 1 + 3 is the same partition as 3 + 1, while the two distinct compositions 1 + 2 + 1 and 1 + 1 + 2 represent the same partition 2 + 1 + 1.

PrepKit 概览

本概览由 PrepKit 编辑根据源代码仓库撰写并审核,并非资源本身的文字。

适合人群
来源未说明适用级别
形式
参考资料

涵盖内容

  • 4 的全部五种拆分
  • 为什么 1 + 3 和 3 + 1 算作同一种拆分
  • 1 到 8 各数拆分的杨图,展示共轭拆分

使用建议

这是 PrepKit 的学习建议,并非来源的说法。

写一个统计 n 的拆分数的动态规划,检查 n = 4 时结果为 5,并解释循环顺序如何避免把 1 + 3 和 3 + 1 重复计数。

范围与局限

没有计数算法、递推式或复杂度;这些都在维基百科和 YouTube 链接之后。

获取方式与形式

GitHub 上采用 MIT 许可的 trekhleb/javascript-algorithms 仓库中的免费英文 README。

PrepKit 于 2026年10月2日 审核。 资源来源提交: 85293e3e2b88

本概览的依据
  • src/algorithms/math/integer-partition/README.md

收录此条目的页面

订阅 PrepKit 通讯

可选。使用 PrepKit 并不需要订阅。

我们如何处理你的邮箱