 So we found a way of solving linear congruences and so the natural question to ask is Can we solve any congruence a x congruent to be mod n and the answer is? No, for example, let's consider the congruence 4x congruent to 1 mod 18 So let's try our diafontein method on this congruence If 4x is congruent to 1 mod 18, then we know that 4x is equal to a multiple of 18 plus Solving this for x gives us and splitting our fraction into a part that reduces and leftovers gives us and if we want x to be a whole number and y to be a whole number then it's necessary that 2y plus 1 over 4 is Also a whole number and so we'll introduce a new variable for this fractional part We'll call this z and then solve for y and then we'll split our fraction into a part that reduces and a part that doesn't and so we get y equal to 2z minus 1 half and At this point we're in trouble because of z is an integer y can't be Because y is 2 times an integer minus 1 half and that will keep it from being an integer No problem. You say maybe z isn't an integer. Well, there is a problem here If z is not an integer remember that z is 2y plus 1 over 4 So if z is not an integer then neither is 2y plus 1 over 4 so x won't be an integer And what this means is that 4x congruent to 1 mod 18 has no solution Now let's take a little bit deeper to see why this happens So remember that one of the properties of congruences is that if a is congruent to b mod n Then a minus b is divisible by n So in order for 4x to be congruent to 1 mod 18, we must have 4x minus 1 divisible by 18 But since 18 is even it can't divide an odd number. So 4x minus 1 must also be even But 4x is even so 4x minus 1 can't be Can we generalize this? Could we solve 3x congruent to 1 mod 18? Again, the way we might look at it is we need 3x minus 1 to be divisible by 18 And notice that anything divisible by 18 is also divisible by 3 But since 3x is divisible by 3 then 3x minus 1 can't be Because it's one less than a number divisible by 3 And so it follows that 3x minus 1 can't be divisible by 18 either and this problem is unsolvable And this leads to the following very important result The congruence ax congruent to 1 mod n can be solved if and only if a and n have no common factors So let's solve if possible 25x congruent to 1 mod 35 And since 25 and 35 have a common factor, this is unsolvable They have to be careful with theorems because you have to read the fine print So let's solve if possible 25x congruent to 5 mod 35 So you might say well 25 and 35 have a common factor and a theorem says that this problem is unsolvable But you got to read the fine print and unlike cell phone contracts theorems don't have Microscopic fine print it's all out in the open and in this particular case the theorem only applies to the congruence ax congruent to 1 But we're not solving 25x congruent to 1 We're solving 25x congruent to 5 And so the theorem is Inapplicable and so we have to do something else to solve this congruence or to determine whether this congruence is unsolvable Well, let's think about this if we had 25x equal to 5 We could divide both sides by 5 to get 5x equals 1 Could we do the same thing here and get 25x over 5 congruent of 5 over 5 Which is the same as 5x congruent to 1 mod 35 and then conclude that this is unsolvable Well, maybe Well, maybe here's a good gauge of whether or not we should stop here Are you willing to throw money down on the table and lose it if you're not right? If you have the slightest hesitation, there's probably more to this problem So let's try to solve this problem using our diafontine method If 25x is congruent to 5 mod 35 then 25x is 5 more than a multiple of 35 And since this is an equation, we can do all the things we can normally do with an equation So let's solve this for x and because our interest is in whole number solutions We'll split our numerator into a part divisible by 25 and a remainder And after simplification we get that x is equal to y plus 10 y plus 5 over 25 Well, we want 10 y plus 5 over 25 to be a whole number so we'll make that a new variable z and solve for y and Again, we'll split our numerator into a part. That's divisible by 10 and leftovers And so y is equal to 2 z plus 5 z minus 5 over 10 Again, we want this fractional part to be a whole number So let's make the new variable and solve for z And then split our fraction into a part that reduces and a part that doesn't And so z is equal to 2 w plus 1 And so now if w is a whole number so is z and so is y and so is x So if we let w equals zero, we find that z is equal to 1 And y is equal to 2 And x is equal to 3 And so x equals 3 solves this congruence And it's worth going back to our original idea that because both 25 and 5 are divisible by 5 We thought we might be able to divide both sides by 5 and get an unsolvable congruence But in fact, we were able to solve the congruence and this brings to mind a very important rule Never divide when working mod n