(*  lerch_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the Lerch *)
(*    function at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  30 January 2006 *)
(*  Author:  John Burkardt *)

xvec={1, 1, 1,  1/2, 1/2, 1/2, 1/3, 1/3, 1/3, 1/10, 1/10, 1/10};
svec = {2, 3, 10, 2, 3, 10, 2, 3, 10, 2, 3, 10 };
avec = {0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3 };
fvec = {};
num = Length [ xvec ];

Do [ {x = xvec[[i]], s=svec[[i]],a=avec[[i]],
f = LerchPhi[x,s,a] ,
fvec = Append [ fvec, f ],
      Print["  Lerch[",x,",",s,",",a,"]=",N[f,16]] },{i,1,num,1}]

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