function A = hermite_to_monomial_matrix ( n )

%*****************************************************************************80
%
%% hermite_to_monomial_matrix() converts from Hermite to monomial form.
%
%  Example:
%
%    N = 11
%
%      1   .   -2      .      12     .   -120     .   1680      .  -30240
%      .   2    .    -12       .   120      . -1680      .  30240       .
%      .   .    4      .     -48     .    720     . -13440      .  302400
%      .   .    .      8       .  -160      .  3360      . -80640       .
%      .   .    .      .      16     .   -480     .  13440      . -403200
%      .   .    .      .       .    32      . -1344      .  48384       .
%      .   .    .      .       .     .     64     .  -3584      .  161280
%      .   .    .      .       .     .      .   128      .  -9216       .
%      .   .    .      .       .     .      .     .    256      .  -23040
%      .   .    .      .       .     .      .     .      .    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 );

  if ( n <= 0 )
    return
  end

  A(1,1) = 1.0;

  if ( n == 1 )
    return
  end

  A(2,2) = 2.0;

  if ( n == 2 )
    return
  end

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

  return
end
