Stirling Number of the First Kind Calculator
Enter n and k to compute the unsigned Stirling number of the first kind.
Result
How it is calculated
The unsigned Stirling number of the first kind c(n, k) counts the permutations of n items that split into exactly k cycles. The tool builds a table with the recurrence c(n, k) = c(n−1, k−1) + (n−1) × c(n−1, k), starting from c(0, 0) = 1. The idea: item n is either alone in its own cycle, which gives the first term, or it is inserted after any of the other n−1 items in an existing cycle, which gives the second.
Inputs are rounded to whole numbers, k must not exceed n, both must be zero or more, and n is limited to 20; anything else gives no result. For n above 0, c(n, 0) is 0, and c(0, 0) is 1. The results are exact integers, even at n = 20 where the numbers have 18 digits, and they are grouped with your language's thousands separator.
Worked example
Find c(6, 3), the number of permutations of 6 items with exactly 3 cycles. The recurrence gives c(6, 3) = c(5, 2) + 5 × c(5, 3). From the table, c(5, 2) = 50 and c(5, 3) = 35. So c(6, 3) = 50 + 5 × 35 = 50 + 175 = 225. The tool also echoes n = 6 and k = 3. As a sense check, summing c(6, k) over all k gives 720, which is 6!, the total number of permutations of 6 items. At the top of the range, c(20, 1) = 19! = 121,645,100,408,832,000.
Common mistakes
- Confusing the first kind with the second kind. The first kind counts permutations by cycles; the second kind counts ways to split a set into groups, and the numbers differ (for n = 6, k = 3 the second kind gives 90).
- Expecting signed values. This tool gives the unsigned (absolute) numbers; the signed version alternates signs and would show negative numbers.
- Entering k larger than n. There is no way to make more cycles than items, so the tool returns nothing rather than 0.
- Entering n above 20. The tool stops at 20, and n = 21 gives no result.
- Typing a decimal such as 5.6 and expecting an error. It is rounded to 6 first, so the result shown belongs to n = 6, and the echoed n confirms which value was used.
About this calculator
The unsigned Stirling number of the first kind, c(n,k), counts the number of ways to arrange n distinct elements into exactly k cycles — closed loops of permutation, as opposed to fixed sequences. They satisfy the recurrence c(n,k) = c(n−1,k−1) + (n−1)·c(n−1,k), building up from the base cases c(0,0)=1 and c(n,0)=0 for n greater than 0.
This calculator computes c(n,k) directly for the n and k you enter. Stirling numbers of the first kind show up in combinatorics, permutation group theory, and the study of algorithms that analyze cycle structure, and they're the coefficients that relate falling factorials to ordinary powers — a useful reference for students and researchers working through combinatorial identities.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
The numbers are coefficients: expand x(x+1)(x+2)(x+3)(x+4)(x+5) and the term in x³ carries 225, which is the tool's answer for n = 6, k = 3. That link is handy for checking a hand expansion or a generating-function exercise. Another reference point is n = 5, k = 5, which returns 1. Values up to n = 20 stay exact, for example 121,645,100,408,832,000 for k = 1. Which counting problem brought you here?