What is the number of solutions of $(a_i)_{i=1}^n$ such that $$\sum_{i=1}^nia_i\le b,\quad a_i\in\{-1,1\},\quad \sum_{i=1}^n{a_i}=c$$ given $b,c\in\mathbf Z$?
Is there a generating function solution?
MathOverflow is a question and answer site for professional mathematicians. It only takes a minute to sign up.
Sign up to join this communityWhat is the number of solutions of $(a_i)_{i=1}^n$ such that $$\sum_{i=1}^nia_i\le b,\quad a_i\in\{-1,1\},\quad \sum_{i=1}^n{a_i}=c$$ given $b,c\in\mathbf Z$?
Is there a generating function solution?
The g.f. equals $$\frac1{1-y}\prod_{i=1}^n \left(xy^i + (xy^i)^{-1}\right).$$ That is, the number of solutions is given by the coefficient of $x^cy^b$.