Re: Congruences

*To*: mathgroup at smc.vnet.net*Subject*: [mg29008] Re: [mg29007] Congruences*From*: Andrzej Kozlowski <andrzej at tuins.ac.jp>*Date*: Fri, 25 May 2001 01:47:48 -0400 (EDT)*Sender*: owner-wri-mathgroup at wolfram.com

on 01.5.24 5:07 PM, Flip at nospam at newsranger.com wrote: > Hi All, > > I was having a difficult time find this in the documentation and was hoping > someone here could help. > > 1. How do you solve the congruence 19 x = 1 mod 140? > > 2. I am trying to verify that x = 12 mod 16 (where x is a 1024-bit number). > How do I do that (essentially the same as question 1.)? > > Thank you ... Flip > > > Method 1: In[3]:= Solve[{19*x == 1, Modulus == 140}, x, Mode -> Modular] Out[3]= {{Modulus -> 140, x -> 59}} Method 2: In[5]:= PowerMod[19,-1,140] Out[5]= 59 I am puzzled by your second question. Have you tried Mod[x,16]? (Or, if x is given in the form a^n: PowerMod[a,n,16]). -- Andrzej Kozlowski Toyama International University JAPAN http://platon.c.u-tokyo.ac.jp/andrzej/ http://sigma.tuins.ac.jp/~andrzej/