20120508, 11:32  #1 
Feb 2011
Singapore
5×7 Posts 
Congruence relations
Hi, i am widely unfamiliar with modular arithmetic and i wanted to know (i tried hard at googling but still seemed to fail) :
if n = a (mod b), when does n = b (mod a) ? 
20120508, 11:44  #2 
"Forget I exist"
Jul 2009
Dartmouth NS
2×3×23×61 Posts 
I made a modular arithmetic thread before, question can you read a clock ? if so you can do modular (clock) arithmetic basics.

20120508, 11:46  #3 
Feb 2011
Singapore
5·7 Posts 

20120508, 11:50  #4 
"Forget I exist"
Jul 2009
Dartmouth NS
2×3×23×61 Posts 

20120508, 11:54  #5 
Feb 2011
Singapore
5·7 Posts 
What about for a  b < n ?
Last fiddled with by Lee Yiyuan on 20120508 at 11:54 
20120508, 12:04  #6 
(loop (#_fork))
Feb 2006
Cambridge, England
2×7×461 Posts 
Ignore scienceman, he's got the wrong definition ...
N=a mod b = b mod a means (Na) is divisible by b and (Nb) divisible by a, there's nothing involving ab. There is always (ok, for a,b>2) an infinite number of solutions to N=a mod b and N=b mod a; to find them, do 'chinese(Mod(a,b),Mod(b,a))' in pari. 
20120508, 12:13  #7  
Feb 2011
Singapore
5×7 Posts 
Quote:
However pari outputs "inconsistent variables in chinese, b!=a Edit: please ignore my previous comment, i am still struggling with grasping PARI Last fiddled with by Lee Yiyuan on 20120508 at 12:20 Reason: en 

20120508, 12:55  #8 
Jun 2003
1010100111100_{2} Posts 
You can do it the hard way, but essentially, the solution boils down to N=kab+a+b.
start with, n = ax+b = by+a rearranging, a(x1) = b(y1) ratio, (y1)/(x1) = a/b = (ka)/(kb) general solution, y = ka+1, x = kb+1 substituing back, n = kab + a + b 
Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Linear Congruence order 4 sequence not testing in PFGW?  carpetpool  Software  14  20170713 19:54 
Congruence  storm5510  Math  27  20090922 23:14 
More relations mean many more relations wanted  fivemack  Factoring  7  20070804 17:32 
Congruence notation  meknowsnothing  Math  1  20070531 03:32 
congruence mod 2^p1  abiessuunreg  Miscellaneous Math  3  20050307 21:03 