Your expression for $p(x)$ is
$$ \sum_{k_i\ge 0}\left(\frac{x^{\sum_{i=1}^\infty ik_i}}{\prod_{i=1}^\infty k_i!(i!)^{k_i}}\right)=\sum_{k_i\ge 0}\left(\prod_{i=1}^\infty\frac{x^{i k_i}}{k_i!(i!)^{k_i}}\right). $$
Now, when you expand $\displaystyle \prod_{i=1}^\infty \left(\sum_{k_i=0}^\infty \frac{x^{ik_i}}{k_i!(i!)^{k_i}}\right)$ what you do is, for each $i$, pick a $k_i$, then form the product of all the corresponding $\displaystyle \frac{x^{ik_i}}{k_i!(i!)^{k_i}}$, resulting in $\displaystyle \prod_{i=1}^\infty\frac{x^{i k_i}}{k_i!(i!)^{k_i}}$, and then add all these expressions, but that is precisely what the displayed sum is. (Of course, one picks $k_i=0$ for almost all $i$ in order for the expressions to be meaningful.)
As the comments with Brian indicate, the confusion is perhaps over the way the author is using notation. It is perhaps better to write the first expression as follows: Let ${\mathbb N}^{\mathbb N}_*$ be the set of all functions $f:\mathbb N^+\to\mathbb N$ (all sequences) such that $f(n)=0$ for all but finitely many $n$. The first sum is then
$$ \sum_{f\in\mathbb N^{\mathbb N}_*}\left(\frac{x^{\sum_{i=1}^\infty i f(i)}}{\prod_{i=1}^\infty (f(i))!(i!)^{f(i)}}\right). $$
On the other hand, the product is just
$$ \prod_{i=1}^\infty \left(\sum_{j=0}^\infty \frac{x^{i j}}{j!(i!)^{j}}\right). $$
When you expand, you pick for each $i$ a $j$ (which, naturally, depends on $i$, so we can call it $f(i)$), with the understanding that you pick $j=0$ almost all the time. Etc.
The way the book writes the expressions, essentially the same notation is used to mean two completely different things: First, $k_i\ge0$ means you are looking at an infinite sequences $(k_1,k_2,\dots)$ with almost all $k_i$ being $0$ (this is just an $f\in{\mathbb N}^{\mathbb N}_*$). The second time, in $\sum_{k_i=0}^\infty$, the author now just means $\sum_{n=0}^\infty$, but is using $k_i$ as the index, rather than $n$.
At the bottom of it, what the author is using is a generalized distributive law, a more general case of which would be that in a sufficiently complete Boolean algebra,
$$ \bigwedge_{a\in X}\bigvee\{u_{a,i}\mid i\in I_a\}=\bigvee_{f\in\prod_{a\in X}I_a}\bigwedge\{u_{a,f(a)}\mid a\in X\} $$
for $X$ a non-empty set, $I_a$ a non-empty index set (for each $a\in X$) and arbitrary elements $u_{a,i}$ of the Boolean algebra (for $a\in X, i\in I_a$), though I doubt that this more general presentation would actually clarify things. This family of generalized distributive laws, by the way, is just a reformulation of the axiom of choice.
One final remark is that it is not capriciousness that makes us look only at functions in $\mathbb N^{\mathbb N}_*$ rather than all functions $f:\mathbb N^+\to\mathbb N$: We are actually looking at all functions, but only the ones in ${\mathbb N}^{\mathbb N}_*$ "matter". There are two ways of interpreting the expansions we have. One is purely formal, and then the convention that almost all $k_i$ must be $0$ is essentially a matter of definitions, but this convention is adopted because of the second way: Namely, we can consider the expansions as defining analytic functions (for an appropriate interval where they converge, typically $|x|<1$).
Note that given a sequence $k_1,k_2,\dots$, we have that $\displaystyle \lim_{n\to\infty}\prod_{i=1}^n \frac{x^{i k_i}}{k_i!(i!)^{k_i}}=0$ if $k_i\ne 0$ infinitely often (more precisely, we say that the product diverges to $0$), essentially because $\displaystyle\frac{x^i}{i!}\to0$ as $i\to\infty$. But then the only sequences $f:i\mapsto k_i$ that contribute to the sum are the ones in ${\mathbb N}^{\mathbb N}_*$ anyway.
You are indeed given that
$$\sum_{i=1}^{n}a_i=\frac{n(n-3)}{2}$$
and upon substituting $n=100$, we get
$$\frac{100(97)}{2}=4850$$
It is correct.
Remark:
The correction is the second equality should be a minus sign, from there we can prove that $a_n=n$ and hence the sum of the first $100$ positive integers is $5050$.
That is the actual question is
Let $a_1, a_2, \ldots , a_n$ be real numbers such that
\begin{align}&\sqrt{a_1}+\sqrt{a_2-1}+\sqrt{a_3-2}+\ldots + \sqrt{a_n-(n-1)} =\\
&\frac12 (a_1+a_2+\ldots+a_n)\color{red}-\frac{n(n-3)}4\end{align}
Compute the value of $\sum_{i=1}^{100}a_i$.
Best Answer
By induction on $d$.
$$\begin{aligned} \frac{1}{1-ab_1} \frac{1}{1-ab_2} &= \left(\sum_{n=0}^\infty (ab_1)^n\right)\left(\sum_{n=0}^\infty (ab_2)^n\right)\\ &=\sum_{n=0}^\infty \left(\sum_{l=0}^nb_1^lb_2^{n-l}\right) a^n\\ &=\sum_{n=0}^\infty \left(\sum_{c_1+c_2=n}b_1^{c_1} b_2^{c_2}\right) a^n \end{aligned}$$
according to Cauchy product formula.
Now apply again Cauchy product formula to pass from $d$ to $d+1$:
$$\begin{aligned} \prod_{i=1}^{d+1} \frac{1}{1 - a b_i} &=\left(\prod_{i=1}^{d} \frac{1}{1 - a b_i}\right)\frac{1}{1 - a b_{d+1}}\\ &= \left(\sum_{n=0}^\infty \left(\sum_{c_1+ \dots +c_d=n}b_1^{c_1} \dots b_d^{c_d}\right) a^n\right)\left(\sum_{n=0}^\infty (ab_{d+1})^n\right)\\ &= \sum_{n=0}^\infty \left(\sum_{l=0}^n \left(\sum_{c_1+ \dots +c_d=l}b_1^{c_1} \dots b_d^{c_d}\right)b_{d+1}^{n-l}\right)a^n\\ &=\sum_{n=0}^\infty \left(\sum_{c_1+\dots + c_{d+1}=n}b_1^{c_1} \dots b_{d+1}^{c_{d+1}}\right) a^n \end{aligned}$$