On a separate note, this is a very inefficient way to sum a series like this. You are recomputing the binomial
factor and powers like c[k]^p
separately for each loop iteration, when in practice you can compute them much more efficiently using a recurrence relation from the previous term.
1 Like