Understand the subject
What is an integer composition?
An integer composition writes a positive integer as positive parts while keeping their order. Here, 1 + 3 and 3 + 1 are different.
Use it when ordered stages, cuts, or sequences of positive parts matter.
See the structure
Separator positions create ordered parts
1│11111│11111│13 compositions
Worked example
Check the rule with a small case
Four into exactly two positive ordered parts gives C(3,1) = 3.
Interpret with care
Choose the right counting model
Composition is not partition: reordering parts changes the result.
Use the Permutation & Combination Generator when a small case needs to be inspected rather than only counted.
Quick guide
How to use this calculator
- Enter a positive integer n.
- Optionally specify an exact number of positive parts.
- Read the number of ordered compositions.
Calculation method
Choose separators between unit positions
There are 2^(n−1) compositions of n into any positive number of parts. Exactly k parts gives C(n−1,k−1).
Worked example
Compose four into two parts
The ordered compositions are 1+3, 2+2, and 3+1.
C(3,1) = 3
Supported inputs
Precision and limits
Discrete domain
Inputs are whole counts. Negative, fractional, grouped, and scientific-notation inputs are rejected.
Exact integers
Results use arbitrary-precision integers and are never rounded. Inputs and output size are bounded to keep the page responsive.