Re: Find the largest integer a or b without comparisons??



Robert Israel wrote:
Robert Israel wrote:

If x and y are positive integers, try

x + y - (x mod y) - (y mod x)
+ ((x mod y) mod x) + ((y mod x) mod y)
- ((x mod y) - ((x-1) mod y)-1) *((y mod x) - ((y-1) mod x)-1)/x

Let that be F(x,y). Then for any integers u and v, try
F(u^2 + v^2 + u + 1, u^2 + v^2 + v + 1) - u^2 - v^2 - 1

Robert Israel israel@xxxxxxxxxxx
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada

Hi Robert,

Why does that work? What are you talking about?

When they're coprime the x mod y mod x, for example 5 and 2 goes 5 2 2
but 6 and 3 goes 6 3 6.

Then you have some product there, we can plug in the other formula,
have min(x,y) + max(x,y) = x + y, the product is the x mod y and x-1
mod y, minus one, the difference of those, times vice versa for x and
y.

Then that's F(x,y), you're saying that's max(x,y) for positive integer
x, y, and it only uses mods except for the divide by x at the end, what
the hell is that doing there? What's the point?

Thank you very much,

Ross

.



Relevant Pages

  • Re: elementary number theory result
    ... Robert Israel wrote: ... > James Pirk wrote: ... >> I am reading a paper which states a number theory result to show ... >> Let P be a subset of positive integers closed under addition. ...
    (sci.math)
  • Re: minimum of a function into two variables
    ... Robert Israel wrote: ... I need some suggestion, ... assuming that n and p are positive integers, ... Now I wonder if there are any nontrivial solutions when P_s = 2^-12. ...
    (sci.math)
  • Re: Find the largest integer a or b without comparisons??
    ... If x and y are positive integers, ... x, y, and it only uses mods except for the divide by x at the ... the hell is that doing there? ...
    (sci.math)
  • Re: A Diophantine Equation
    ... Maury Barbato writes: ... consider the integer solutions of the equation ... Robert Israel wrote: ... for distinct positive integers a and b. ...
    (sci.math)
  • Re: GCD(0,0)
    ... Yes, it's fair, but it's also incorrect. ... which divide into a and b, not numbers that a and b divide into. ... > It's also fair to argue that since the definition of GCD ... product of positive integers up to and including 0" requires that we ...
    (sci.math)