(*  zeta_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the Zeta *)
(*    function at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  15 February 2006 *)
(*  Author:  John Burkardt *)

nvec = {2, 3, 4, 5, 6,
7, 8, 9, 10, 11,
12, 16, 20, 30, 40};
fvec = {};
num = Length [ xvec];

Do [ { n = nvec[[i]], f = Zeta[n] ,
fvec = Append [ fvec, f ],
      Print["Zeta[",n,"]=",N[f,16]] },{i,1,num,1}]

fileout=OpenWrite["C:\\Documents and Settings\\burkardt\\Desktop\\Misc\\mathematica\\zeta_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  zeta_values.txt"];today=DateList[];Write[fileout,"#  Created on ",today];Write[fileout,"#"];
Write[fileout,"#  n  f"];
Write[fileout,"#"];
Do[{n=nvec[[i]];f=fvec[[i]];Write[fileout,n,"  ",N[f,16]]},{i,1,num,1}];Close[fileout];