function j = search ( a, b, c )

%*****************************************************************************80
%
%% SEARCH searches integers in [A,B] for a J so that F(J) = C.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    22 October 2012
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer A, B, the search range.
%
%    Input, integer C, the desired function value.
%
%    Output, integer J, the computed solution, or -1
%    if no solution was found.
%
  j = -1;

  for i = a : b

    fi = f ( i );

    if ( fi == c )
      j = i;
      return
    end

  end

  return
end

