function x = diophantine_4d_positive ( a, b )

%*****************************************************************************80
%
%% diophantine_4d_positive finds positive diophantine solutions.
%
%  Discussion:
%
%     We are given a Diophantine equation 
%
%       a1 x1 + a2 x2 + a3 x3 + a4 x4 = b
%
%     for which the coefficients a are positive integers, and
%     the right hand side b is a nonnegative integer.
%
%     We are seeking all strictly positive integer solutions x.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    17 May 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer a(4): the coefficients of the Diophantine equation.
%
%    integer b: the right hand side.
%
%  Output:
%
%    integer x(4,k): solutions to the equation.
%
   bn = b - sum ( a );

   x = diophantine_4d_nonnegative ( a, bn );

   x = x + 1;

  return
end

