(*  partition_count_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the partition count *)
(*    function at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  20 February 2006 *)
(*  Author:  John Burkardt *)

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

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

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