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

nvec = {1,2,4,8,16,32,64,128,256,512,1000, 2000,4000,8000,16000,32000,64000,128000,256000,512000,1024000,2048000,4096000,8192000,16384000};
fvec = {};
num = Length [ nvec ];

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

fileout=OpenWrite["/panfs/panasas1/users/jburkardt/public_html/math_src/test_values/prime_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  prime_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];