Ooops.
%%% (309) -> stirling1(0,0)$IntegerCombinatoricFunctions(Integer)
(309) 0
Type: Integer
That should be 1, right?
stirling1(n, m) ==
-- Definition: (-1)^(n-m) S[n, m] is the number of
-- permutations of n symbols which have m cycles.
n < 0 or m < 1 or m > n => 0
m = n => 1
S.Sn = n => coefficient(S.Sp, convert(m)@Z :: N)
x := monomial(1, 1)$SUP(I)
S.Sn := n
S.Sp := x
for k in 1 .. convert(n-1)@Z repeat S.Sp := S.Sp * (x - k::SUP(I))
coefficient(S.Sp, convert(m)@Z :: N)
It seems that the condition "m < 1" in the first line should only be
applied if n>0, i.e. it should be:
n < 0 or (n > 0 and m < 1) or m > n => 0
Probably the same problem in stirling2.
Ralf
--
You received this message because you are subscribed to the Google Groups "FriCAS -
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/fricas-devel/66421c4a-6353-4053-8973-4e0f67e1f301%40hemmecke.org.