id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
13695 Subsets(1)[x] behaves strangely for x in SR ppurka sage-combinat "This bug is from the [https://spreadsheets.google.com/pub?key=pCwvGVwSMxTzT6E2xNdo5fA sage notebook bug report page].
{{{
A = Subsets(1);
k=var('k')
sum((-1)^(A[k].cardinality()),k,0,A.cardinality()-1)
Sage gives me 2 as an answer, while it should be 0.
}}}
The problem seems to be in `sage.combinat.subset.Subsets_s.unrank` which does not check whether the arguments it receives are integers or not. So, doing something like the title gives the empty set and so we get 2 as the answer above.
{{{
sage: Subsets(1)[x]
{}
}}}" defect closed major sage-duplicate/invalid/wontfix combinatorics wontfix Vincent Delecroix N/A