Homology of product of spheres

Statement
Let $$(m_1,m_2,\ldots,m_r)$$ be a tuple of nonnegative integers. Let $$A$$ be the space $$S^{m_1} \times S^{m_2} \times S^{m_3} \times \ldots \times S^{m_r}$$. Then the homologies of $$A$$ are free Abelian, and the $$q^{th}$$ Betti number is given by the following formula:

$$b_q(A) = \left| \left \{ T \subset \{ 1,2,3,\ldots,r \} | \sum_{i \in T} m_i = q \right \} \right |$$

In other words $$b_q(A)$$ is the number of ways $$q$$ can be obtained by summing up subsets of $$(m_1,m_2,\ldots,m_r)$$.

A particular case of this is when all the $$m_i$$s are 1, viz the torus. In this case:

$$b_q(A) = {r \choose q}$$

An alternative interpretation of the above result is that $$b_q(A)$$ is the coefficient of $$x^q$$ in the following:

$$\prod_{i=1}^r (1 + x^{m_i})$$

In other words, the Poincare polynomial of $$A$$ is the product of the Poincare polynomials of the individual spheres (note that the Poincare polynomial of a product of topological spaces is not in general the product of the Poincare polynomials.

Euler characteristic
The Euler characteristic of the product of spheres can be obtained by plugging $$(-1)$$ in the above polynomial. From this it turns out that the Euler characteristic is $$0$$ if any of the spheres has odd dimension, and is $$2^r$$ if all the spheres have even dimension.

Using exact sequence for join and product
The above claim can be easily proved using induction, and the exact sequence for join and product.