home *** CD-ROM | disk | FTP | other *** search
-
- (*********************************************************************
-
- Adapted from
- Roman E. Maeder: Programming in Mathematica,
- Second Edition, Addison-Wesley, 1991.
-
- *********************************************************************)
-
-
- SwinnertonDyerP::usage = "SwinnertonDyerP[n, var] gives the minimal polynomial
- of the sum of the square roots of the first n primes."
-
- Begin["`Private`"]
-
- SwinnertonDyerP[n_Integer?Positive, x_] :=
- Module[{arglist, poly},
- arglist = Outer[Times, Sqrt[Prime[Range[n]]], {-1, 1}];
- poly = Outer[Plus, {x}, Sequence @@ arglist];
- Expand[Times @@ Flatten[poly]]
- ]
-
- End[ ]
-
- Null
-