%I #32 Jun 12 2022 18:49:20
%S -2,1,1,-10,1,576,-960,352,-40,1,46225,-5596840,13950764,-7453176,
%T 1513334,-141912,6476,-136,1,2000989041197056,-44660812492570624,
%U 183876928237731840,-255690851718529024,172580952324702208,-65892492886671360,15459151516270592
%N Triangle read by rows: nonzero coefficients of Swinnerton-Dyer polynomials.
%D Roman E. Maeder. Programming in Mathematica, Addison-Wesley, 1990, page 105.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Swinnerton-DyerPolynomial.html">Swinnerton-Dyer Polynomial</a>
%e First few rows are:
%e [1] -2, 1;
%e [2] 1, -10, 1;
%e [3] 576, -960, 352, -40, 1;
%e [4] 46225, -5596840, 13950764, -7453176, 1513334, -141912, 6476, -136, 1;
%e ....
%e -2 + x^2, 1 - 10*x^2 + x^4, 576 - 960*x^2 + 352*x^4 - 40*x^6 + x^8, ...
%t SwinnertonDyerP[0, x_ ] := x; SwinnertonDyerP[n_, x_ ] := Module[{sd, srp = Sqrt[Prime[n]]}, sd[y_] = SwinnertonDyerP[n - 1, y]; Expand[ sd[x + srp] sd[x - srp] ] ]; row[n_] := CoefficientList[ SwinnertonDyerP[n, x], x^2]; Table[row[n], {n, 1, 5}] // Flatten (* _Jean-François Alcover_, Nov 09 2012 *)
%t (* Second program: *)
%t SwinnertonDyerP[n_Integer?Positive, x_] :=
%t Block[{arg, poly, i},
%t args = Outer[Times, Table[Sqrt[Prime[i]], {i, n}], {-1, 1}];
%t poly = Outer[Plus, {x}, Sequence @@ args];
%t Expand[Times @@ Flatten[poly]]]
%t Table[Select[CoefficientList[SwinnertonDyerP[n, x], x], # != 0 &], {n, 1, 4}] // TableForm (* _Peter Luschny_, Jun 12 2022 *)
%o (Julia)
%o using Nemo
%o function A153731Row(n)
%o R, x = PolynomialRing(ZZ, "x")
%o p = swinnerton_dyer(n, x)
%o [coeff(p, j) for j in 0:2:2^n] end
%o for n in 1:4 A153731Row(n) |> println end # _Peter Luschny_, Mar 13 2018
%o (Magma) // Note that Magma, like Mathworld, defines the polynomials for n >= 1.
%o P<x> := PolynomialRing(IntegerRing());
%o for n := 1 to 5 do
%o p := SwinnertonDyerPolynomial(n);
%o [c : c in Coefficients(p) | not IsZero(c)];
%o end for; // _Peter Luschny_, Jun 12 2022
%Y Cf. A247209, A354913 (left column).
%K sign,tabf
%O 1,1
%A _Eric W. Weisstein_, Dec 31 2008