function A = monomial_to_hermite_matrix ( n )

%*****************************************************************************80
%
%% monomial_to_hermite_matrix() converts monomial to Hermite form.
%
%  Example:
%
%    N = 11 (Each column must be divided by the factor below it).
%
%    1     .     2     .    12     .   120     .  1680     . 30240
%    .     1     .     6     .    60     .   840     . 15120     .
%    .     .     1     .    12     .   180     .  3360     . 75600
%    .     .     .     1     .    20     .   420     . 10080     .
%    .     .     .     .     1     .    30     .   840     . 25200
%    .     .     .     .     .     1     .    42     .  1512     .
%    .     .     .     .     .     .     1     .    56     .  2520
%    .     .     .     .     .     .     .     1     .    72     .
%    .     .     .     .     .     .     .     .     1     .    90
%    .     .     .     .     .     .     .     .     .     1     .
%    .     .     .     .     .     .     .     .     .     .     1
%
%   /1    /2    /4    /8   /16   /32   /64  /128  /256  /512 /1024
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 February 2024
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the order of A.
%
%  Output:
%
%    real A(N,N), the matrix.
%
  A = zeros ( n, n );

  A(1,1) = 1.0;

  if ( n == 1 )
    return
  end

  A(2,2) = 0.5;

  if ( n == 2 )
    return
  end

  for j = 3 : n
    for i = 1 : n
      if ( i == 1 )
        A(i,j) = ( ( j - 2 ) * A(i,j-2)              ) / 2.0;
      else
        A(i,j) = ( ( j - 2 ) * A(i,j-2) + A(i-1,j-1) ) / 2.0;
      end
    end
  end

  return
end
