function prime_fermat_test ( )

%*****************************************************************************80
%
%% prime_fermat_test() tests prime_fermat().
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    20 September 2024
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../prime_fermat' );

  timestamp ( );
  fprintf ( 1, "\n" );
  fprintf ( 1, "prime_fermat_test():\n" );
  fprintf ( 1, "  MATLAB/Octave version %s\n", version ( ) );
  fprintf ( 1, "  prime_fermat() applies Fermat's primality test to an integer.\n" );

  k = 3;
  fprintf ( 1, "\n" );
  fprintf ( 1, "  The test will be repeated with %d different bases.\n", k );
  fprintf ( 1, "\n" );

  for n = [ 11, 15, 221 ]

    value = is_prime ( n, k );
    if ( value )
      fprintf ( 1, "  %d may be a prime.\n", n );
    else
      fprintf ( 1, "  %d is definitely not a prime.\n", n );
    end
  end
%
%  Terminate.
%
  fprintf ( 1, "\n" );
  fprintf ( 1, "prime_fermat_test():\n" );
  fprintf ( 1, "  Normal end of execution.\n" );
  timestamp ( );

  rmpath ( '../prime_fermat' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 November 2022
%
%  Author:
%
%    John Burkardt
%
  t = now ( );
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

