Re: Find the largest integer a or b without comparisons??
- From: "Ross A. Finlayson" <raf@xxxxxxxxxxxxxxx>
- Date: 25 Oct 2006 20:29:46 -0700
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
.
- Follow-Ups:
- Re: Find the largest integer a or b without comparisons??
- From: Robert Israel
- Re: Find the largest integer a or b without comparisons??
- References:
- Find the largest integer a or b without comparisons??
- From: qq
- Re: Find the largest integer a or b without comparisons??
- From: fm2766
- Re: Find the largest integer a or b without comparisons??
- From: David W . Cantrell
- Re: Find the largest integer a or b without comparisons??
- From: Gerard Schildberger
- Re: Find the largest integer a or b without comparisons??
- From: Robert Israel
- Re: Find the largest integer a or b without comparisons??
- From: Robert Israel
- Find the largest integer a or b without comparisons??
- Prev by Date: Re: It can take 500 years
- Next by Date: Re: Riemann geometry, chicken or the egg?
- Previous by thread: Re: Find the largest integer a or b without comparisons??
- Next by thread: Re: Find the largest integer a or b without comparisons??
- Index(es):
Relevant Pages
|