(*  binomial_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the Binomial function *)
(*    values fx(a,b), *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  02 December 2005 *)
(*  Author:  John Burkardt *)

avec = { 1, 6, 6, 6, 15, 15, 15, 15, 15, 15,
15, 25, 25, 25, 25, 25, 25, 25, 25, 25}
bvec = {0, 1, 3, 5, 1, 3, 5, 7, 9, 11,
13, 1, 3, 5, 7, 9, 11, 13, 15, 17 }
fvec = {}
num = Length [ avec]

Do[{
 a = avec[[i]], 
b = bvec[[i]], 
f = Binomial[a,b],
fvec = Append[fvec,f],
Print["Binomial[",a,",",b,"]=",f]
}, {i, 1, num,1}]

fileout=OpenWrite["/Users/burkardt/public_html/math_src/test_values/binomial_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  binomial_values.txt"];today=DateList[];Write[fileout,"#  Created on ",today];Write[fileout,"#"];
Write[fileout,"#  a  b  fx"];
Write[fileout,"#"];
Do[{a=avec[[i]];b=bvec[[i]];f=fvec[[i]];Write[fileout,N[a,16],"  ",N[b,16],"  ",N[f,16]]},{i,1,num,1}];Close[fileout];