# Counting the number of sets [closed]

Given two positive integers $n$ and $k$ with the same parity, count the number of sets $$S = \{0 < s_1 < s_2 < \dots < s_k = n\},$$ such that $s_1, s_3, \dots$ are odd numbers, and $s_2, s_4,\dots$ are even numbers.

## closed as off-topic by Rohan, ArsenBerk, Especially Lime, Claude Leibovici, Jaideep KhareJan 26 '18 at 11:07

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Rohan, ArsenBerk, Especially Lime, Claude Leibovici, Jaideep Khare
If this question can be reworded to fit the rules in the help center, please edit the question.

Hint. The problem is equivalent to count the number of non-negative integer solutions of the equation $$(2x_1+1)+(2x_2+1)+ \dots+ (2x_k+1)=n$$ that is $$x_1+x_2+ \dots+ x_k=\frac{n-k}{2}.$$ Then $s_i=\sum_{j=1}^i(2x_j+1)$ for $i=1,2,\dots,k$. To count such solutions use Stars and bars technique.