(*  sphere_unit_volume_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the unit sphere volume *)
(*    function at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  10 February 2006 *)
(*  Author:  John Burkardt *)

nvec = {};
Do [ { n = i, nvec = Append [ nvec, n ]},{i,1,20,1}]
fvec = {};
num = Length [ nvec ];

Do [ { n = nvec[[i]],f = 2*Pi^(n/2)/(n*Gamma[n/2]),
fvec = Append [ fvec, f ],
      Print["  Volume[",n,"]]=",N[f,16]] },{i,1,num,1}]

fileout=OpenWrite["C:\\Documents and Settings\\burkardt\\Desktop\\Misc\\mathematica\\sphere_unit_volume_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  sphere_unit_volume_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];