We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cad751d commit 48c188dCopy full SHA for 48c188d
src/sage/combinat/integer_vector.py
@@ -960,7 +960,7 @@ def unrank(self, x):
960
[1, 9]
961
"""
962
rtn = [self.n]
963
- while self.rank(rtn) < x:
+ while self.rank(rtn) <= x:
964
rtn.append(0)
965
rtn.pop()
966
@@ -1075,7 +1075,7 @@ def rank(self, x):
1075
1076
n, k = sum(x), self.k
1077
1078
- r = sum(binomial(k + i - 1, k - 1) for i in range(n))
+ r = binomial(n+k-1, k)
1079
1080
for i in range(k - 1):
1081
k -= 1
@@ -1090,7 +1090,7 @@ def unrank(self, x):
1090
1091
INPUT:
1092
1093
- - ``x`` -- an integer such that x < self.cardinality() ``
+ - ``x`` -- an integer such that x < self.cardinality()``
1094
1095
EXAMPLES::
1096
0 commit comments