Re: Congruences
- To: mathgroup at smc.vnet.net
- Subject: [mg29009] Re: [mg29007] Congruences
- From: Adriano Pascoletti <pascolet at dimi.uniud.it>
- Date: Fri, 25 May 2001 01:47:49 -0400 (EDT)
- References: <200105240807.EAA05001@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
At 4:07 -0400 24-05-2001, Flip 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 1. You can use LinearSolve[ M, c, Modulus->p] where M is the 1 x 1 matrix {{19}}, c the 1-dimensional vector {1} and p=140: In[29]:= LinearSolve[{{19}},{1},Modulus->140] Out[29]= {59} 2. Being 16=2^4 use this FromDigits[#, 2] &[Take[IntegerDigits[x, 2], -4]] == 12 Adriano Pascoletti
- References:
- Congruences
- From: Flip <nospam@newsranger.com>
- Congruences