| answer
After image enhancement, the invoice shows that 72 canned
hams were purchased at $5.11 each for a total of $367.92.
Unfortunately, the amount was deciphered just as two burly,
mean-looking men from the Hack-em-up Hog Farm arrived (with
meat hooks) requesting their $367.92 that was four months
overdue.
Moral: Always keep your hams out of hock!
|
|
I find the answer 72 * $5.11 = $367.92 in the following manner:
Dividing 1 by 72 yields the residual differences*
1, 10, 28, 64, 64, 64, 64, ...
64 64 64 64 64 64 64 64 28 10 1
0 0 0 0 0 0 x 6 7 9 y
which means that 64*x + 64*6 + 28*7 + 10*9 + 1*y must be congruent
to 0 mod 72. Reducing this yields
y is congruent to 8*x + 50 (mod 72)
Plugging in the integers from 0 to 9 into x gives the following
table:
x y (mod 72)
=== ==========
0 50
1 58
2 66
3 2
4 10
5 18
6 26
7 34
8 42
9 50
The only value in the table where 0<=y<=9 is when x=3; thus, 367.92
is the product. 367.92 / 72 = 5.11.
====================================================================
* I don't believe the term "residual differences" is correct, but
I can't recall the correct terminology. They are calculated by
dividing 1 by the number (in this case 72), recording the intermediate
differences:
0
______________
72 ) 10000000000
0
-
1 <- first residual difference
00
______________
72 ) 10000000000
0
-
10
00
--
10 <- second residual difference
001
______________
72 ) 10000000000
0
-
10
00
--
100
72
---
28 <- third residual difference
0013
______________
72 ) 10000000000
0
-
10
00
--
100
72
---
280
216
---
64 <- fourth residual difference
00138
______________
72 ) 10000000000
0
-
10
00
--
100
72
---
280
216
---
640
576
---
64 <- fifth and continued residual differences
|
| re 547.2
Another way is to note that
72*z = 10000*x + 6790 + y
implies
0 = (10000 mod 72)*x + (6790 mod 72) + y, modulo 72
or equivalently,
0 = 64*x + 22 + y, modulo 72
Thus, we'd like to find solutions to 72k = 64x + 22 + y, with
0 <= x,y <= 9. We could notice immediately that y must be even.
Actually, because gcd(72,64) = 8, we'll consider this equation
modulo 8. This gives:
0 = (22 mod 8) + y, modulo 8
or 0 = 6 + y, modulo 8
or 2 = y, modulo 8.
Here, we can trivially solve the following two equations for y:
y mod 8 = 2 and 0 <= y <= 9
|