# Solve modular equation

## Homework Statement

Find the integer y with both 0 < y < 144 and 35y = 42(mod 144)

## The Attempt at a Solution

Can someone help me get started on this one? I understand that I can reduce it to 5y = 6(mod 144), and then to 5y = 6 + 144... but I'm not sure what to do with that. I mean, can I just do 5y = 150 and then y = 30?

jbunniii
Homework Helper
Gold Member

## Homework Statement

Find the integer y with both 0 < y < 144 and 35y = 42(mod 144)

## The Attempt at a Solution

Can someone help me get started on this one? I understand that I can reduce it to 5y = 6(mod 144), and then to 5y = 6 + 144... but I'm not sure what to do with that. I mean, can I just do 5y = 150 and then y = 30?

If you plug $$y = 30$$ into the original equation, is it true? If so, then you're done.

An interesting question to consider: if instead of 35, the original equation had 36, then your method would fail. Why? Does the equation have a solution in that case?

A more ambitious question: what is a necessary and condition upon k in order for

ky = 42 (mod 144)

to have a solution? Does the answer change if instead of 42 you use some other number between 0 and 143?

I'm a little confused here. So if I plug my answer into the equation and it doesn't work, it means there are no solutions? And I don't know the answer to the second question

I have another one here:

0 < x < 41
19x = 22(mod 41)

You're right, my previous method didn't work. What can I do?

jbunniii
Homework Helper
Gold Member

I have another one here:

0 < x < 41
19x = 22(mod 41)

You're right, my previous method didn't work. What can I do?

Do you know this theorem:

ax = b (mod n)

has a solution if and only if gcd(a,n) divides b.

In this case, gcd(a,n) = 1 since 19 and 41 are relatively prime. So a solution does exist.

Any solution to this equation:

ax + kn = b, where k is any integer

is also a solution to

ax = b (mod n)

There is a well-known algorithm for finding integers x and k that satisfy

ax + kn = b

provided that a solution exists. Are you familiar with it?

No. :(

Last edited:

I'm still stuck on this... can anyone give me a hand?

HallsofIvy