I want to write a program in Maple that can helps us to generate the polynomial with variables (for example a, b, c) if we know a, b, c are three roots of an equation.
Let me show an example of this program:
Give $a,b,c$ are three root of $x^3-7x^2+14x-7=0$ then output the polynomial with $a,b,c$ (the degree of this polynomial maybe input by the user). For example I give the degree equal to 2, it may returns:
$$f(a,b,c)=-ab+2ac+b^2-bc-c^2$$
where in $f(a,b,c)$ if we substitute $a,b,c$ by the root of $x^3-7x^2+14x-7=0$ by some order, it will equal to 0.
Moreover, I wish the generated-polynomial should not be symmetric. To be honest, in a large program I want to write is a sum of squares polynomial program. And this is one of the small steps of that program.
Thanks a lot!
This is not an answer to the intended question, only an attempt to ascertain what the actual question was meant to be.
My current interpretation of the question looks as follows (using $\bar{x}$ as shorthand for $x_1,\ldots,x_m$) : We are given a polynomial $P(x)$ with roots $r_1,\ldots,r_m$. For a given $n$, we are seeking a polynomial $f(\bar{x})$ of degree $n$ such that $f(r_{\sigma(1)},\ldots,r_{\sigma(m)})=0$ where $\sigma$ is some permutation ("order") of indices $\{1,\ldots,m\}$.
If we ignore the requirement the degree of $f(x)$ being $n$ for a moment, there are two classes of simple solutions shown in the comments by another user:
It is also clear that if $f(\bar{x})$ is a valid solution, then $f(\bar{x})g(\bar{x})$ is also a valid solution, for any polynomial $g$. Furthermore, both types of solutions presented above are not just equal to zero for some permutation $\sigma$ of the roots, but rather for any permutation of them and thus if $f_1(\bar{x})$ and $f_2(\bar{x})$ are two solutions, so is $f_1(\bar{x})+f_2(\bar{x})$.
However, these solutions might have some properties that the original poster intuitively wanted to exclude but didn't express this explicitly yet: