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

xvec = {0,1/2,1/4,3/4,1/10,
2/10, 3/10, 4/10, 5/10, 6/10,
7/10, 8/10, 9/10, 95/100, 975/1000,
103125/100000, 10625/10000, 1125/1000, 125/100, 15/10, 2, 4, 8, 16, 32, 64,
128, 256, 512, 1024, 2048};
fvec = {};
num = Length [ xvec ];

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

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