#17161: Implement the unsigned Lah numbers
-----------------------------+-------------------------------
   Reporter:  pluschny       |            Owner:
       Type:  enhancement    |           Status:  new
   Priority:  minor          |        Milestone:  sage-6.4
  Component:  combinatorics  |         Keywords:  Lah numbers
  Merged in:                 |          Authors:
  Reviewers:                 |  Report Upstream:  N/A
Work issues:                 |           Branch:
     Commit:                 |     Dependencies:
   Stopgaps:                 |
-----------------------------+-------------------------------
 Implement the unsigned Lah numbers which for n>=1, k>=1 are
 the number of ways a set of n elements can be partitioned into
 k nonempty linearly ordered subsets.

 Lah numbers are defined for all integers n, k by the following
 formula if the Stirling numbers are extended to negative integers
 n, k in the way it is recommended by Graham/Knuth/Patashnik
 in 'Concrete Mathematics' Section 6.1 (see Table 253).
 (This extension is implemented in GAP’s Stirling functions.)
 {{{
 def Lah(n,k):
     return sum(stirling_number1(n,j)*stirling_number2(j,k,"gap") for j in
 (k..n))
 }}}
 (Note how inconsistently at present this formula has to be
 written to get consistent results (because stirling_number1
 and stirling_number2 are based on different, non-compatible
 algorithms! See also ticket #17159)

 {{{
 for n in (-6..6):
     print [Lah(n,k) for k in (-6..6)]

     1,   .,  ., ., ., ., .,   .,    .,    .,   .,  ., .,
    30,   1,  ., ., ., ., .,   .,    .,    .,   .,  ., .,
   300,  20,  1, ., ., ., .,   .,    .,    .,   .,  ., .,
  1200, 120, 12, 1, ., ., .,   .,    .,    .,   .,  ., .,
  1800, 240, 36, 6, 1, ., .,   .,    .,    .,   .,  ., .,
   720, 120, 24, 6, 2, 1, .,   .,    .,    .,   .,  ., .,
     .,   .,  ., ., ., ., 1,   .,    .,    .,   .,  ., .,
     .,   .,  ., ., ., ., .,   1,    .,    .,   .,  ., .,
     .,   .,  ., ., ., ., .,   2,    1,    .,   .,  ., .,
     .,   .,  ., ., ., ., .,   6,    6,    1,   .,  ., .,
     .,   .,  ., ., ., ., .,  24,   36,   12,   1,  ., .,
     .,   .,  ., ., ., ., ., 120,  240,  120,  20,  1, .,
     .,   .,  ., ., ., ., ., 720, 1800, 1200, 300, 30, 1,
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/17161>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to