/* swindyer : a little procedure to compute so-called Swinnerton-Dyer polynomials, which are interesting because they are irreducible, but split into factors of degree at most 2 modulo every prime input: plist --- list of primes */ swindyer:= proc(plist) local result,i,l,fac,j; begin result:=1; for i from 0 to 2^(nops(plist))-1 do l:=numlib::g_adic(i,2); fac:=hold(x); for j from 1 to nops(plist) do if op(l,j)=1 then fac:=fac+sqrt(plist[j]) else fac:=fac-sqrt(plist[j]) end_if; end_for; result:=result*fac; end_for; result end_proc: