function perm_inv = perm_inverse3 ( n, perm )

%*****************************************************************************80
%
%% perm_inverse3() produces the inverse of a given permutation.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    05 January 2007
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the number of items permuted.
%
%    integer PERM(N), a permutation.
%
%  Output:
%
%    integer PERM_INV(N), the inverse permutation.
%
  perm_inv(perm(1:n)) = ( 1 : n );

  return
end
