function middle_square_cycle_length_test ( )

%*****************************************************************************80
%
%% middle_square_cycle_length_test() tests middle_square_cycle_length().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    18 June 2023
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'middle_square_cycle_length_test():\n' );
  fprintf ( 1, '  middle_square_cycle_length ( s, d ) applies the middle\n' );
  fprintf ( 1, '  square algorithm using a 2*d digit seed, and reports\n' );
  fprintf ( 1, '  the number of steps taken before a cycle was entered,\n' );
  fprintf ( 1, '  and the length of that cycle.\n' );

  s = 7074;
  d = 2;

  [ cycle_length, steps ] = middle_square_cycle_length ( s, d );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  For a middle square sequence with %d digits,\n', 2*d );
  fprintf ( 1, '  the sequence starting at seed %d\n', s );
  fprintf ( 1, '  took %d steps,\n', steps );
  fprintf ( 1, '  before repeating a value in a cycle of length %d\n', cycle_length );

  return
end

