(*  partition_distinct_count_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the partition distinct 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 = PartitionsQ[n] ,
fvec = Append[fvec,f],
 Print[ "f[", n,"] = ",f] 
}, {i,1, num,1} ]

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