(*  i_factorial2_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the double factorial *)
(*    function at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  22 January 2006 *)
(*  Author:  John Burkardt *)

xvec = {};
Do [ { x = i, xvec = Append [ xvec, x ] ,
  },{i,0,15,1}]
fvec = {};
num = Length [ xvec ];

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

fileout=OpenWrite["C:\\Documents and Settings\\burkardt\\Desktop\\Misc\\mathematica\\factorial2_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  factorial2_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,x,"  ",N[f,16]]},{i,1,num,1}];Close[fileout];