klocey / partitions

python based code for integer partitioning
4 stars 4 forks source link

watch out for k that is too large #21

Closed smichr closed 3 years ago

smichr commented 8 years ago

In first_lexical watch out for k that is too large:

elif k < min_max(q, n):
->
elif k < min_max(q, n) or k > q - n + 1:

test:

assert first_lexical(20, 4, 18) is None

klocey commented 3 years ago

Done. Thanks!