function bal_seq_unrank_test ( )

%*****************************************************************************80
%
%% BAL_SEQ_UNRANK_TEST tests BAL_SEQ_UNRANK.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    25 November 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'BAL_SEQ_UNRANK_TEST\n' );
  fprintf ( 1, '  BAL_SEQ_UNRANK unranks a balanced sequence of N items.\n' );

  rank = 21;
  n = 5;

  t = bal_seq_unrank ( rank, n );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Rank = %d\n', rank );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  The element of that rank is:\n' );
  fprintf ( 1, '\n' );
  for i = 1 : 2 * n
    fprintf ( 1, '%2d', t(i) );
  end
  fprintf ( 1, '\n' );

  return
end
