Question: In Lotto 6/49 exist 13 983 816 possible combinations which is the number of permutations of six (unordered) numbers up to 49.
Define predicate combinations which find the number of combinations K of up to N numbers. Validate your predicate with the subsequent test:
?- combinations(6,49,13983816). true