1 /* Original version of this file copyright 1999 by Michael Wester,
2 * and retrieved from http://www.math.unm.edu/~wester/demos/Combinatorics/problems.macsyma
5 * Released under the terms of the GNU General Public License, version 2,
6 * per message dated 2007-06-03 from Michael Wester to Robert Dodier
7 * (contained in the file wester-gpl-permission-message.txt).
9 * See: "A Critique of the Mathematical Abilities of CA Systems"
10 * by Michael Wester, pp 25--60 in
11 * "Computer Algebra Systems: A Practical Guide", edited by Michael J. Wester
12 * and published by John Wiley and Sons, Chichester, United Kingdom, 1999.
14 /* ----------[ M a c s y m a ]---------- */
15 /* ---------- Initialization ---------- */
18 /* ---------- Combinatorial Theory ---------- */
19 /* Pochhammer symbol (a)_n = a (a + 1) ... (a + n - 1) => a (a + 1) (a + 2) */
21 /* Binomial coefficient => n (n - 1) (n - 2)/6 */
23 /* 2^n n! (2 n - 1)!! => (2 n)! */
25 2^n * n! * (2*n - 1)!!;
27 ratsimp(subst(ceiling((2*n - 1)/2) = n, %));
29 /* 2^n n! product(2 k - 1, k = 1..n) => (2 n)! */
30 2^n * n! * product(2*k - 1, k, 1, n);
32 /* => (2 n)!/[2^(2 n) (n!)^2] or (2 n - 1)!!/[2^n n!] */
33 gamma(n + 1/2)/(sqrt(%pi) * n!);
35 /* Partitions of an integer => {1+1+1+1, 1+1+2, 1+3, 2+2, 4} (5 in all) */
37 /* Stirling numbers of the first kind: S_1(5, 2) => -50 */
39 /* Euler's totient function => 576 */