Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Sure, what you are looking for is the falling factorial.

for n in (0..7) : [falling_factorial(n,k) for k in (0..n)]
[1]
[1, 1]
[1, 2, 2]
[1, 3, 6, 6]
[1, 4, 12, 24, 24]
[1, 5, 20, 60, 120, 120]
[1, 6, 30, 120, 360, 720, 720]

[1, 7, 42, 210, 840, 2520, 5040, 5040]

Sure, what you are looking for is the falling factorial.

for n in (0..7) : [falling_factorial(n,k) for k in (0..n)]
[1]
[1, 1]
[1, 2, 2]
[1, 3, 6, 6]
[1, 4, 12, 24, 24]
[1, 5, 20, 60, 120, 120]
[1, 6, 30, 120, 360, 720, 720]

[1, 7, 42, 210, 840, 2520, 5040, 5040]

5040]