Artificial intelligent assistant

Finding the nth Coefficient of Polynomial Say I have a polynomial of degree 26, one that I obtain when I expand $(X-a)(X-b)(X-c)*...*(X-z)$ (x and X aren't the same so $(X-x)$ isn't 0), How could I find coefficient $a_{14}$ without going through the painstaking multiplication? For example I would start with $(X-a)(X-b) = X^2 -(a+b)X + ab$, and then do $(X^2 -(a+b)X + ab)(X-c) = X^3 - (a+b+c)X^2 - (ab-ac-cb)X -abc$ and so on, but is there an easier way to find $a_{14}$? Should there be some sort of pattern?

There is: these are given by Vieta's formulae. In the case of a degree-$26$ polynomial and the coefficient of $a_{14}$, it is given by the symmetric polynomial of degree $26-14=12$ in $-a,-b,\dotsc,-z$, which itself is the sum of all the products of $12$ distinct elements of this set, i.e. $$ (-1)^{12} (abcefghijkl + abcefghijkm + abcefghijkln + \dotsc + abcefghijlm + \dotsc + opqrstuvwxyz ) . $$

Another way to see this is to multiply out all the brackets at once: the products with $14$ $X$'s must contain $12$ factors that aren't $X$, so must each contain $12$ distinct elements of $-a,-b,\dotsc,-z$. All such factors are included, so again the result follows. You can see the same patterns in the quadratic and the cubic you calculated explicitly.

(Yes, there are an awful lot of terms here, roughly 9.6 million. This is unfortunately inevitable, although simplifications may be possible if they have specific values rather than being general.)

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 86dbe0233d32835624cc16e56e54dd61