Dear Uncle Colin,

I need to find 351(mod234), but I’m not getting the right answer. Can you help me? 1

- It’s Not Very Easy Resolving Such Expressions

Hi, INVERSE, and thanks for your message!

We’re looking for a number x such that 35x=234n+1, for some value of n.

My first instinct is to ask “am I sure this has an inverse?” - 35 is 5×7 and 234=2×32×13, so we’re ok - the two numbers are coprime.

Brute force

One way to do this is to examine multiples of 35 until we find one that fits the bill.

  • 7×35=24511(mod234)
  • 14×35=49022(mod234)
  • 21×35=73533(mod234)
  • 27×35=9459(mod234)

I don’t know about you, but I’m bored already. We have machines for this sort of thing.

Fives and sevens

We can be a bit cleverer than this because we can factorise 35 as 5×7. In particular, we can say 35x=(5a)(7b) for some value of a and b. If both 5a and 7b are congruent to 1, modulo 234, we’re flying!

It’s easy to find a: 47×5=235, so a=47 works.

b is harder: 235 is not a multiple of 7 (231 is the closest one to 234). However, if we try 469, we see that it’s 67×7 - so b=67.

So, what’s ab? Well, multiplying those together gives 3,149. Technically, that’s an inverse. However, it’s not quite as we want it: ideally, our inverse will lie between 0 and 233 (inclusive) - so we need to find 3149(mod234).

I’d first take away 2340 to get 809. Then I’d work out that 3×234=702 and take that away to get 107. That is in the interval we want - and 107×351(mod234).

So, in Z234, 351=107.

Another method

From what we worked out above:

  • 7×3511(mod234)
  • 27×359(mod234)
  • So 20×352(mod234)
  • … and (27+4×20)×35(9+4×(2))(mod234), which is 1.

That works out to be 107, as we had before!


Hope that helps!

- Uncle Colin

Footnotes:

1. This student attached their working.