function [ n_data, m, n, f ] = gcd_values ( n_data )

%*****************************************************************************80
%
%% gcd_values() returns values of the greatest common divisor function.
%
%  Discussion:
%
%    f = gcd(m,n) if f divides m and n evenly, and no larger integer does.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    26 December 2022
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N_DATA.  The user sets N_DATA to 0 before the first call.  
%    Thereafter, it should simply be the value returned by the previous call.
%
%  Output:
%
%    integer N_DATA.  On each call, the routine increments N_DATA by 1, and
%    returns the corresponding data; when there is no more data, the
%    output value of N_DATA will be 0 again.
%
%    integer M, N, the arguments of the function.
%
%    integer F, the value of the function.
%
  n_max = 10;

  f_vec = [ ...
    1,  2,  3,  4,  5, ...
    6,  7,  8,  9, 10 ];

  m_vec = [ ...
    17,    4, 291,    100,    55, ...
    30, 2058,  24, 326880, 65610 ];

  n_vec = [ ...
    35, 138322, 294,     64,    625, ...
    66,    679,  40, 131769, 146410 ];

  if ( n_data < 0 )
    n_data = 0;
  end

  n_data = n_data + 1;

  if ( n_max < n_data )
    n_data = 0;
    m = 0;
    n = 0;
    f = 0;
  else
    m = m_vec(n_data);
    n = n_vec(n_data);
    f = f_vec(n_data);
  end

  return
end
