the Swinnerton-Dyer polynomials are defined as $$SD_n(x) = \prod(x \pm \sqrt{2} \pm \sqrt{3} \pm ... \pm \sqrt{p_n})$$ where the product is taken over all possible permutations of $+$ or $-$ signs. $p_n$ is the nth prime number and the sum is taken over primes smaller or equal to $p_n$.
My idea for computation of their coefficients (which turns out to be faster than just expanding) is the following recursive procedure:
Compute $p(x) = SD_{n-1}(x)$
Compute $p(x+\sqrt{p_n})$ and $p(x-\sqrt{p_n})$
Expand the product $p(x+\sqrt{p_n})p(x-\sqrt{p_n})$
My question is now: Is there a more efficient way of computing $SD_n(x)$ in expanded form (Maybe even without the use of radicals in the computation)?
Your recursion works, and it might be not the most efficient. In as far I would be also interested in better evaluation strategies or other polynomials that can be also used to compute the reciprocal as I do at the end of this answer.
I was trying it symbolically, and do get also integer coefficients when $p_1,..,p_n$ are not only prime numbers but other rational numbers. I use the
library(groebner/generic), which is a Jekejeke Prolog package for polynomials and vectors. The following Prolog program does the job:You can then invoke it as follows, and all the coffections use squares of the roots:
By construction $f((x_1,..,x_n),x)$ is divisible by $x+x_1+..+x_n$, let denote the result of this divison by $g((x_1,..,x_n),x)$, a recursion for this function can be also built. So that in the end we have a way to compute ${(p+\sqrt{p_1}+..+\sqrt{p_n})}^{-1}$ as $g((\sqrt{p_1},..,\sqrt{p_n}),p) / f((\sqrt{p_1},..,\sqrt{p_n}),p)$.