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

nvec = {1,2,3,4,5,
6,7,8,9,10,
30,101,210,1320,1764,
2003,2310,2827,8717,12553,
30030,510510,9699690};
fvec = {};
num = Length [ nvec ];

Do[{ n = nvec[[i]], f = Length[FactorInteger[n]],
fvec = Append [ fvec, f ],
Print["Omega[",n,"]=",f]
}, {i, 1, num,1}]

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