I am looking to find the number of ways to pay a £50 bill in £1 and £2 coins. The generating function for this is $g(x)=(1+x+...)(1+x^2+...)$, which after a few lines of algebra becomes
$g(x) = \sum_{i=0}^{\infty}(1+i)x^i\sum_{j=0}^{\infty}(-1)^jx^j$.
The following is the only formula I can think of for finding the coefficient $\alpha$ of $x^{50}$ in $g(x)$
$\alpha = \sum_{k=0}^{50}(-1)^k(51-k) = 26$,
but this feels quite tedious. My first question is whether or not this answer is correct. The second is whether there is another, more elegant way to find this coefficient $\alpha$.
The number of ways to pay for a £50 bill is equivalent to the number of £2 coins that can be used to make an amount less than or equal to 50 as the rest of the bill can be paid with £1 coins. This leaves 26 options for the number of £2 coins: 0, 1, ... 25.