(*  catalan_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the Catalan *)
(*    numbers at selected argument values C(n), *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  04 January 2006 *)
(*  Author:  John Burkardt *)

nvec = {0,1,2,3,4,5,6,7,8,9,10}
cvec = {};
num = Length [ nvec ];

Do[{ n = nvec[[i]], c = Binomial[2*n,n]/(n+1),
cvec = Append [ cvec, c ],
Print["C[",n,"]=",c]
}, {i, 1, num,1}]

fileout=OpenWrite["C:\\Documents and Settings\\burkardt\\Desktop\\Misc\\mathematica\\catalan_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  catalan_values.txt"];today=DateList[];Write[fileout,"#  Created on ",today];Write[fileout,"#"];
Write[fileout,"#  n  cn"];
Write[fileout,"#"];
Do[{n=nvec[[i]];c=cvec[[i]];Write[fileout,n,"  ",c]},{i,1,num,1}];Close[fileout];