On Tue, 28 Apr 2009 at 04:10PM -0700, William Stein wrote:
> Maple 13 was released today, I think.  The "new features" page is here:
[...]
>     * The combinatorics package now includes the Eulerian numbers of
> first and second order.
[...]
> I don't know anything about Eulerian numbers.

def eulerian1(n, k):
    return Permutations(n).filter(lambda p: p.number_of_descents() == 
k).cardinality()

Now you know something about Eulerian numbers. :)

There's also a simple Pascal-like recursion.

Dan

-- 
---  Dan Drake <dr...@kaist.edu>
-----  KAIST Department of Mathematical Sciences
-------  http://mathsci.kaist.ac.kr/~drake

Attachment: signature.asc
Description: Digital signature

Reply via email to