![]() |
![]() |
#1 |
Feb 2011
Singapore
5×7 Posts |
![]()
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) ? |
![]() |
![]() |
![]() |
#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.
|
![]() |
![]() |
![]() |
#3 |
Feb 2011
Singapore
5·7 Posts |
![]() |
![]() |
![]() |
![]() |
#4 |
"Forget I exist"
Jul 2009
Dartmouth NS
2×3×23×61 Posts |
![]() |
![]() |
![]() |
![]() |
#5 |
Feb 2011
Singapore
5·7 Posts |
![]()
What about for |a - b| < |n| ?
Last fiddled with by Lee Yiyuan on 2012-05-08 at 11:54 |
![]() |
![]() |
![]() |
#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 (N-a) is divisible by b and (N-b) divisible by a, there's nothing involving a-b. 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. |
![]() |
![]() |
![]() |
#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 2012-05-08 at 12:20 Reason: en |
|
![]() |
![]() |
![]() |
#8 |
Jun 2003
10101001111002 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(x-1) = b(y-1) ratio, (y-1)/(x-1) = a/b = (ka)/(kb) general solution, y = ka+1, x = kb+1 substituing back, n = kab + a + b |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Linear Congruence order 4 sequence not testing in PFGW? | carpetpool | Software | 14 | 2017-07-13 19:54 |
Congruence | storm5510 | Math | 27 | 2009-09-22 23:14 |
More relations mean many more relations wanted | fivemack | Factoring | 7 | 2007-08-04 17:32 |
Congruence notation | meknowsnothing | Math | 1 | 2007-05-31 03:32 |
congruence mod 2^p-1 | abiessuunreg | Miscellaneous Math | 3 | 2005-03-07 21:03 |