bugs in function stirling1() in version 5.21.1 (and up?)



Because i can make neither head nor tail
from the "bug reporting" at sourceforge,
i write to this list.
For the rest of this text "You" adresses persons
documenting. maintaining or developing Maxima.
That said:

To whom it may concern!

Maxima (as do other programs. e.g. PARI/gp) computes
integers (as values of stirling1()) with alternating signs,
whereas Concrete Math 2nd ed defines them non-negative.
This should be stressed in the documentation, where it is
now hidden (a bit) by
"the magnitude of stirling1 (n, m) is the number of permutations of
 a set with n members that have m cycles".
This is not a bug but a nuisance -- at least to me.

The bugs are the following, consistently in the program and its documentation:
	stirling1(n+1,2) simplifies to 2^n-1,
which is simply not true, even when disregarding the signs
(with H(n):=sum(1/k,k,1,n); it should be
	stirling1(n+1,2) simplifies to H(n)*n!*(-1)^(n-1)
). although the numbers computed for instantiated
n are correct (modulo the previous remark).
The simplifications
	stirling1(n+1,1) to n!			and
	stirling1(n+1,n) to binomial(n,2)
would only be true, had you defined the function stirling1()
to return non-negative values (which you don't)
and thus should be
	stirling1(n+1,1) to (-1)^n*n!		and
	stirling1(n+1,n) to -binomial(n,2)

Furthermore there are some typos in the documentation of the function
stirling2().
Concrete Math 2nd ed eqn. (6.19) states for m,n >= 0
	m!*stirling2(n,m) = sum(binomial(m,k)*k^n*(-1)^(m-k),k,0,m)
but for this to work also for stirling2(0,0), 0^0 would have to be
defined as 1, which is not the standart with Maxima.
I couldn't provoke this simplification anyway in the program,
so it might as well be taken out of the documentation.

Maxima version: 5.21.1
Maxima build date: 8:13 4/26/2010
Host type: i686-pc-mingw32
Lisp implementation type: GNU Common Lisp (GCL)
Lisp implementation version: GCL 2.6.8

With best regards,
Bernhard W. Marx