For the sake of completeness here is a slightly different approach to part one, which then continues along the path in the link from Brian Scott.
The generating function of the set of partitions by the number of parts is given by
$$ G(z,u) = \prod_{k\ge 1} \frac{1}{1-uz^k}.$$
It follows that the generating function of the set of partitions with an even number of parts is given by
$$ G_1(z) = \frac{1}{2} G(z, 1) + \frac{1}{2} G(z, -1)
= \frac{1}{2} \prod_{k\ge 1} \frac{1}{1-z^k}
+ \frac{1}{2} \prod_{k\ge 1} \frac{1}{1+z^k}.$$
Similarly for an odd number of parts,
$$ G_2(z) = \frac{1}{2} G(z, 1) - \frac{1}{2} G(z, -1)
= \frac{1}{2} \prod_{k\ge 1} \frac{1}{1-z^k}
- \frac{1}{2} \prod_{k\ge 1} \frac{1}{1+z^k}.$$
Therefore
$$ G_1(z) - G_2(z) = Q(z) = \prod_{k\ge 1} \frac{1}{1+z^k}$$
and this is the generating function of the difference between the number of partitions into an even and odd number of parts.
Now observe that this is
$$\prod_{k\ge 1} \frac{1-z^k}{1-z^{2k}}
= \prod_{k\ge 0} (1-z^{2k+1})$$
because the denominator cancels all the factors with even powers in the numerator.
Here is an important observation: the above expression of $Q(z)$ enumerates partitions into unique odd parts in a generating function of signed coefficients where the sign indicates the parity of the number of parts. There is no cancellation between partitions that add up to the same value because the counts of constituent parts have the same parity. Moreover as all parts are odd, partitions of odd numbers must have an odd number of parts and of even numbers, an even number. Therefore the coefficients of $Q(z)$ alternate in sign.
To get the series that generates the absolute values of these coefficients, we create generating functions for the even powers and the odd ones, inverting the sign of the coefficients of the odd ones. The even ones are generated by
$$\frac{1}{2} Q(z) + \frac{1}{2} Q(-z)$$
and the odd ones by
$$-\left(\frac{1}{2} Q(z) - \frac{1}{2} Q(-z)\right)$$
Adding these gives $$ Q(-z).$$
But this is
$$\prod_{k\ge 0} (1-(-z)^{2k+1})
= \prod_{k\ge 0} (1-(-1)^{2k+1} z^{2k+1})
= \prod_{k\ge 0} (1+ z^{2k+1}),$$
precisely the generating function of partitions into distinct odd parts.
This is sequence A000700 from the OEIS.
Best Answer
Set $$\epsilon_j=a_j-a_{j+1} \quad \text{ for } \quad 1\leq j\leq r-1.$$ Then we have
$$ a_{r-j}=1+\epsilon_{r-1}+\cdots +\epsilon_{r-j} \quad \text{ for } \quad 1\leq j\leq r-1,$$ so $$ n=r+(r-1)\epsilon_{r-1}+ (r-2)\epsilon_{r-2}+\cdots +2\epsilon_2+\epsilon_1 $$ defines a partition of $n$ with all distinct parts (ignoring the summands with $\epsilon_j=0$) and highest part being $r$. The correspondence thus defined is bijective: follow the same steps in reverse order.