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

nvec = {1,2,3,4,5,6,7,8,9,10,
30,127,128,129,210,360,617,815,816,1000 };
fvec = {};
num = Length [ nvec ];

Do [ { n = nvec[[i]], f = DivisorSigma[1,n] ,
fvec = Append [ fvec, f],
      Print["Sigma[n]=",f] },{i,1, num,1}]

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