Expanding function into formal infinite product I cannot understand the right side of the equation. How is this equation expanded to formal infinite product function from middle to right
$$f(x) = 1 - x - \sum_{n = 1}^{\infty}d^n x^{n +1} = \prod_{n = 1}^{\infty} (1 - a_n x^n).$$
 A: Every formal power series $f(x) \in 1 + x k[[x]]$ ($k$ a commutative ring) with constant term $1$ has a unique factorization into an infinite product of this form
$$f(x) = \sum_{n \ge 0} f_n x^n = \prod_{n=1}^{\infty}(1 + a_n x^n).$$
(Switching to the minus sign amounts to replacing $a_n$ by $-a_n$.) The coefficients $a_n$ are uniquely determined by the coefficients $f_n$ inductively as follows. By comparing linear terms we have $f_1 = a_1$ and comparing quadratic terms we have $f_2 = a_2$. The first interesting comparison is the cubic term, which gives
$$f_3 = a_3 + a_1 a_2.$$
Hence because $a_1, a_2$ have been uniquely determined, $a_3$ is uniquely determined from $f_3$. In general we have
$$f_n = \sum_{\sum n_i = n} \prod a_{n_i}$$
where the sum runs over unordered tuples of distinct positive integers $\{ n_i \}$ such that $\sum n_i = n$. There is a unique term $a_n$ and all the other terms involve $a_k, k < n$ so by induction have been uniquely determined by the terms $f_k, k < n$. Hence $a_n$ is also uniquely determined.
This construction shows up in one approach to the big Witt vectors. I don't know what its relevance is to your situation.
Edit: The proof of Fermat's little theorem in the article you linked to based on these ideas appears to be related to the cyclotomic identity
$$\frac{1}{1 - qx} = \prod_{n \ge 1} \left( \frac{1}{1 - x^n} \right)^{M(q, n)}$$
where $M(q, n) = \frac{1}{n} \sum_{d \mid n} \mu(d) q^{n/d}$ are the necklace polynomials. For integer values of $q, n$ this is an integer which is a generalization of Fermat's little theorem, to which it reduces when $n$ is prime.
