Let $\mathbf{X} = (X_0,\ldots,X_k) \sim Mul(n,\mathbf{p})$ be a multinomial RV. We define the following hypothesis test: $$H0: \mathbf{p} = \mathbf{p_0} := (p_{01},\ldots, p_{0k})$$ versus $$H1: \mathbf{p} \neq \mathbf{p_0}$$
Pearson's $\chi^2$ test statistics is $$T(\mathbf{X}) = \sum_{i=1}^k \frac{(X_i-np_i)^2}{np_i}$$ Pearson's $\chi^2$ test assumes: $T(\mathbf{X}) \sim \chi^2_{k-1}$.
How does $T(\mathbf{X})$ follow chi-square distribution? For $\chi^2$ distribution each term under summation should be square of standard normal RV. According to my comuptations, $$\sum_{i=1}^k \frac{(X_i-np_i)^2}{np_i(1-p_i)}\sim \chi^2_{k-1}$$ Is there any theoretical explaination for missing $1-p_i$ term in denominatior.