Menu

#4976 integer_partitions(n,0) claims the empty list is a partition of n

None
open
nobody
5
13 hours ago
13 hours ago
No

integer_partitions(5,0) returns {[]} instead of the empty set

Maxima 5.49post, SBCL 2.6.7.

(%i1) display2d:false$
(%i2) integer_partitions(5,0);
(%o2) {[]}
(%i3) integer_partitions(0,0);
(%o3) {[]}

Expected: (%o3) = {[]} is correct, since the empty list is the unique partition of 0. (%o2) should be {}: there is no partition of 5 into 0 parts, and the returned [] sums to 0, not 5.

Discussion


Log in to post a comment.