Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Ben, il suffit d'iterer :

sage: for c in Combinations([1,2,3,4,5,6,7], 5): 
....:     if 5 in c: 
....:         print(c) 
....:                                                                           
[1, 2, 3, 4, 5]
[1, 2, 3, 5, 6]
[1, 2, 3, 5, 7]
[1, 2, 4, 5, 6]
[1, 2, 4, 5, 7]
[1, 2, 5, 6, 7]
[1, 3, 4, 5, 6]
[1, 3, 4, 5, 7]
[1, 3, 5, 6, 7]
[1, 4, 5, 6, 7]
[2, 3, 4, 5, 6]
[2, 3, 4, 5, 7]
[2, 3, 5, 6, 7]
[2, 4, 5, 6, 7]
[3, 4, 5, 6, 7]