Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

falling_factorial produces AttributeError

  • Mathematica:

    Table[FactorialPower[n, n - k - 1], {n, 0, 5}, {k, 0, n}]
    {{1}, {1, 1/2}, {2, 1, 1/3}, {6, 3, 1, 1/4}, {24, 12, 4, 1, 1/5}}
    
    • Maple:

      ff := (n,k) -> n!/(n-k)!:
      for n from 0 to 5 do seq(ff(n, n-k-1), k=0..n) od;
                  1
                1, 1/2
              2, 1, 1/3
            6, 3, 1, 1/4
          24, 12, 4, 1, 1/5
      
    • Sage:

       for n in range(6): [falling_factorial(n, n-k-1) for k in (0..n)]
       AttributeError: 'int' object has no attribute 'parent'