stirling1
- :
s =stirling1(n, k)¶ Unsigned Stirling numbers of the first kind.
stirling1 (N, K)returns the number of permutations of n elements with exactly k cycles (the unsigned cycle numbers c(n,k) = |s(n,k)|). Both n and k must be real non-negative integer scalars. The result is0when k > n (except c(0,0) = 1).Output class follows
nchoosek:doubleby default,singleif either argument is single, or the common integer class when both arguments share one.Behaviour note (MATLAB R2026a):
stirling1/stirling2are not shipped by MathWorks in R2026a. This Nexus API uses the unsigned first-kind convention sostirling1 (5, 2) == 50(nexus#1853 golden). Signed values are(-1)^(n-k) * stirling1 (n, k).