mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2016-03-20, 18:19   #1
a1call
 
a1call's Avatar
 
"Rashid Naimi"
Oct 2015
Remote to Here/There

3·5·137 Posts
Default xa-by<c

Hi,
Not sure where would be the appropriate section for this. I figure it could be posted as a puzzle even though I don't know the answer.

For non zero positive integers a, b, c, x, and y,
find a general solution for x and y for the inequality:
0<|xa-by|<c

where:
c=|a-b|

Notes:

* There are values for a and b which there are no solutions for such as:
a = 66
b = 55

yet for:
a = 66
b = 57
66 - 57 = 9
13 x 66 - 57 x 15 = 3 < 9
i.e.:
x = 13 and y = 15

Thank you.

Last fiddled with by a1call on 2016-03-20 at 18:37
a1call is offline   Reply With Quote
Old 2016-03-20, 18:37   #2
retina
Undefined
 
retina's Avatar
 
"The unspeakable one"
Jun 2006
My evil lair

22×1,549 Posts
Default

Quote:
Originally Posted by a1call View Post
* There are values for a and b which there are no solutions for such as:
a = 66
b = 55
x=10, y=12

ETA: Nevermind, OP edited the original post stipulating an extra condition 0<|xa-by|<c.

Last fiddled with by retina on 2016-03-20 at 18:42 Reason: Moving the goalposts
retina is offline   Reply With Quote
Old 2016-03-20, 18:43   #3
a1call
 
a1call's Avatar
 
"Rashid Naimi"
Oct 2015
Remote to Here/There

3×5×137 Posts
Default

Quote:
Originally Posted by retina View Post
x=10, y=12

ETA: Nevermind, OP edited the original post stipulating an extra condition 0<|xa-by|<c.
Quote:
Originally Posted by retina View Post
x=10, y=12
I just added the "0<" to the post.

Thank you for pointing that out.
a1call is offline   Reply With Quote
Old 2016-03-20, 18:44   #4
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

the reason 66 and 55 can't work in the scenario you propose is simply because the difference is the GCD. in fact all such solutions with |a-b| = gcd(a,b) are out. so basically as long as c is in not equal to their gcd you can solve bezout's identity for their gcd and use that solution.

Last fiddled with by science_man_88 on 2016-03-20 at 18:51
science_man_88 is offline   Reply With Quote
Old 2016-03-20, 18:51   #5
a1call
 
a1call's Avatar
 
"Rashid Naimi"
Oct 2015
Remote to Here/There

3·5·137 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
the reason 66 and 55 can't work in the scenario you propose is simply because the difference is the GCD. in fact all such solutions with |a-b| = gcd(a,b) are out. so are all the ways to solve Bézout's identity, flipping the sign to deal with the subtraction still doesn't work. so basically as long as c is in not equal to their gcd you can solve bezout's identity for their gcd and use that solution.
I think you are correct about the difference being the GCD.
But the puzzle is still unsolved.
We still need a general solution for x and y.
a1call is offline   Reply With Quote
Old 2016-03-20, 18:59   #6
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

100000110000002 Posts
Default

Quote:
Originally Posted by a1call View Post
I think you are correct about the difference being the GCD..
I know I'm right as a=gcd(a,b)*(a/gcd(a,b)); and b=gcd(a,b)*(b/gcd(a,b)) so plugging these in as a and b gets you that for any x and y you always get a multiple of their gcd the lowest such positive multiple is the gcd itself. I still don't have the general solution you want if you actually want numbers.
science_man_88 is offline   Reply With Quote
Old 2016-03-20, 19:05   #7
a1call
 
a1call's Avatar
 
"Rashid Naimi"
Oct 2015
Remote to Here/There

40078 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
I know I'm right as a=gcd(a,b)*(a/gcd(a,b)); and b=gcd(a,b)*(b/gcd(a,b)) so plugging these in as a and b gets you that for any x and y you always get a multiple of their gcd the lowest such positive multiple is the gcd itself. I still don't have the general solution you want if you actually want numbers.
No not numbers, a general solution would be formulaic.
Thank you for introducing me to Bézout's identity.
See if that can produce a solution to the inequality.
a1call is offline   Reply With Quote
Old 2016-03-20, 19:12   #8
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by a1call View Post
No not numbers, a general solution would be formulaic.
Thank you for introducing me to Bézout's identity.
See if that can produce a solution to the inequality.
if a-b = d*gcd(a,b) then multiplying a solution to bezout's identity by d-1 or less should solve it.
science_man_88 is offline   Reply With Quote
Old 2016-03-20, 19:12   #9
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

947710 Posts
Default

Quote:
Originally Posted by a1call View Post
I think you are correct about the difference being the GCD.
But the puzzle is still unsolved.
We still need a general solution for x and y.
Step 1: A = a/gcd(a,b), B = b/gcd(a,b). Solution for (a,b) exists iff solution for (A,B) exists.
Step 2: if d = |A-B| <= 1, then there is no solution, because there is no d :: 0<d<1.
Otherwise, use Extended Euclidean algorithm \qed
Batalov is offline   Reply With Quote
Old 2016-03-20, 19:21   #10
a1call
 
a1call's Avatar
 
"Rashid Naimi"
Oct 2015
Remote to Here/There

3×5×137 Posts
Default

Quote:
Originally Posted by Batalov View Post
Step 1: A = a/gcd(a,b), B = b/gcd(a,b). Solution for (a,b) exists iff solution for (A,B) exists.
Step 2: if d = |A-B| <= 1, then there is no solution, because there is no d :: 0<d<1.
Otherwise, use Extended Euclidean algorithm \qed
Thank you, I was just about to add the c>1 to the OP. Thank you for pointing that out.
Thank you for solving the puzzle. Didn't take that long.
I will now have to read up on the Extended Euclidean algorithm.
a1call is offline   Reply With Quote
Reply



All times are UTC. The time now is 03:35.


Sat Jul 17 03:35:59 UTC 2021 up 50 days, 1:23, 1 user, load averages: 1.54, 1.84, 1.67

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.