Why is the number of divisors of an integer $n$ equal to the number of factors in the factorization of the polynomial $x^n - 1$ over the integers? Sloane's OEIS A000005 gives the number of divisors of the integer n.  A comment (by a very reputable contributor) in this sequence claims that this is also the number of factors in the factorization of the polynomial $x^n-1$ over the integers.
For example a(6) = 4 because there are 4 divisors of the integer 6 and (apparently) because there are 4 factors in the factorization of $x^6 - 1=  
(-1 + x) (1 + x) (1 - x + x^2) (1 + x + x^2)$.
Is there an easy explanation for this?  How can I count the number of factors in the factorization of $x^n - 1$?  Is there an algorithm to produce these factors? 
I read an article on-line that gave a method to produce all the factors of x^n - 1 with no rational roots ( that is 1 and -1 are not roots) but this is not the same as the  irreducible factors that are being counted in this sequence.

HINT: If $n = ab$, then $x^n -1 = (x^a)^b -1^b$. Now, factorize this as a difference of $b$-th powers and find a bijection between factorizations and divisors.
