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

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

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

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