% ichoose3_sequence.m
%  Compute and print the elements of the "ichoose3" sequence,
%  which counts the number of ways to choose 3 items from a set of I.
%  A(i) = i*(i-1)*(i-2)/6 for i = 0, ..., n.
%
n = input ( 'Enter the highest index to compute: ' );

for i = 0 : n

  value = i * ( i - 1 ) * ( i - 2 ) / 6;
  fprintf ( 'a(%d) = %d\n', i, value );

end

