Sometimes students post this type of problem in elementary mathematics because
they're to do them by guessing and checking, not algebraic methods. Other
times they are posted by college students studying number theory and solving
Diophantine equations. I'll assume you are studying number theory and not in
lower grades doing problems by "trial and error".
----
So that you'll have to do your own work, I'll solve a problem that is solved
exactly the same way but which has different numbers from yours.
At the local grocery store, lemons are 57 cents each and limes are 21 cents
each. How many lemons and limes can you buy for exactly $6.05?
Let x = the number of lemons
Let y = the number of limes
The Diophantine equation is:
57x + 23y = 605
23 is the least coefficient (in absolute value in case it were negative).
Write 57 and 605 in terms of their nearest multiple of 23.
The nearest multiple of 23 to 57 is found by 57/23 = 2.478...
round to the nearest whole number 2. So the nearest multiple of 23
to 57 is 2×23 = 46. So write 57 as 46+11.
The nearest multiple of 23 to 605 is found by 605/23 = 26.3...
round to the nearest whole number 26. So the nearest multiple of 23
to 605 is 26×23 = 598. So write 605 as 598+7.
57x + 23y = 605 becomes:
(46+11)x + 23y = 598 + 7
46x + 11x + 23y = 598 + 7
Divide through by 23
2x + (11/23)x + y = 26 + 7/23
Isolate fractions on the left:
(11/23)x - 7/23 = -2x - y + 26
The right side is an integer, and therefore so is the
left side. Let that integer be A. We set both sides = A
(11/23)x - 7/23 = A -2x - y + 26 = A
Clear the fraction:
11x - 7 = 23A
11 is the least coefficient in absolute value
Write 7 and 23 in terms of their nearest multiple of 11.
The nearest multiple of 11 to 7 is 11. So write 11 as 7+4.
The nearest multiple of 11 to 23 is 22. So write 23 as 22+1.
11x - 7 = 23A
11x - 7 = (22+1)A
11x - 7 = 22A + A
Divide through by 11
x - 7/11 = 2A + A/11
Isolate fractions on the left:
-7/11 - A/11 = 2A - x
The right side is an integer, and therefore so is the
left side. Let that integer be B. We set both sides = B
-7/11 - A/11 = B 2A - x = B
Clear the fraction:
-7 - A = 11B
-A = 11B+7
A = -11B-7
Substitute in 2A - x = B
2(-11B-7) - x = B
-22B-14 - x = B
-x = 23B+14
x = -23B-14
Substitute for A and x in
-2x - y + 26 = A
-2(-23B-14) - y + 26 = A
46B + 28 - y + 26 = -11B-7
46B + 54 - y = -11B-7
-y = -57B-61
y = 57B+61
x > 0 y > 0
-23B-14 > 0 57B+61 > 0
-23B > 14 57B > -61
B < -14/23 B > -61/57
B < -0.6... B > -1.07...
-1.07... < B < -0.6...
Since B is an integer B=-1
x = -23B-14 y = 57B+61
x = -23(-1)-14 y = 57(-1)+61
x = 23-14 y = -57+61
x = 9 y = 4
So 9 lemons and 4 limes.
Now do yours the same way.
Edwin