On Sun, Nov 09, 2025 at 02:40:56PM +0100, 'Ralf Hemmecke' via FriCAS - computer algebra system wrote:
> Patch is attached.
Thanks. Please commit.
> --
> 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
fricas-devel...@googlegroups.com.
> To view this discussion visit
https://groups.google.com/d/msgid/fricas-devel/b4b4d1b7-6dd7-4a8b-a25f-5411d618d4ec%40hemmecke.org.
> From 98709d5d73ddf373c22bae13aca9685b09aad52e Mon Sep 17 00:00:00 2001
> From: Ralf Hemmecke <
ra...@hemmecke.org>
> Date: Sun, 9 Nov 2025 14:37:11 +0100
> Subject: correct stirling1(0,0)=stirling2(0,0)=1
>
> ---
> src/algebra/combinat.spad | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/src/algebra/combinat.spad b/src/algebra/combinat.spad
> index 18ac0dee..17452892 100644
> --- a/src/algebra/combinat.spad
> +++ b/src/algebra/combinat.spad
> @@ -157,6 +157,7 @@ IntegerCombinatoricFunctions(I : IntegerNumberSystem) : with
> stirling1(n, m) ==
> -- Definition: (-1)^(n-m) S[n, m] is the number of
> -- permutations of n symbols which have m cycles.
> + zero? n and zero? m => 1
> n < 0 or m < 1 or m > n => 0
> m = n => 1
> S.Sn = n => coefficient(S.Sp, convert(m)@Z :: N)
> @@ -169,6 +170,7 @@ IntegerCombinatoricFunctions(I : IntegerNumberSystem) : with
> stirling2(n, m) ==
> -- definition: SS[n, m] is the number of ways of partitioning
> -- a set of n elements into m non-empty subsets
> + zero? n and zero? m => 1
> n < 0 or m < 1 or m > n => 0
> m = 1 or n = m => 1
> s : I := if odd? m then -1 else 1
> --
> 2.43.0
>
--
Waldek Hebisch