Question
Question: For a nonnegative integer $x$, let $f(x) = |a-b|$, where $a$ is the remainder when $x$ is divided by...
For a nonnegative integer x, let f(x)=∣a−b∣, where a is the remainder when x is divided by 77 and b is the remainder when x is divided by 143. For how many values of 1≤k≤1001 does 0≤f(k)≤70?
770
Solution
Let
a=xmod77(0≤a≤76), b=xmod143(0≤b≤142)
Since 77 and 143 share the common factor 11, the system
x≡a(mod77), x≡b(mod143)
has a solution if and only if
a≡b(mod11).
Write b=a+11k, k∈Z.
We are given f(x)=∣a−b∣=∣11k∣=11∣k∣≤70.
Thus ∣k∣≤1170⟹∣k∣≤6.
So k∈{−6,−5,−4,−3,−2,−1,0,1,2,3,4,5,6}.
For the solution to be valid, besides 0≤a≤76, we require 0≤a+11k≤142.
For each fixed k, the valid a satisfy
a∈[max(0,−11k),min(76,142−11k)].
Now count the number of integers a for each k:
-
For k=−6:
max(0,66)=66 and min(76,142+66=208)=76.
Count = 76−66+1=11. -
For k=−5:
Lower bound = max(0,55)=55; upper bound = min(76,142+55=197)=76.
Count = 76−55+1=22. -
For k=−4:
Lower bound = 44; upper bound = 76.
Count = 76−44+1=33. -
For k=−3:
Lower bound = 33; upper bound = 76.
Count = 76−33+1=44. -
For k=−2:
Lower bound = 22; upper bound = 76.
Count = 76−22+1=55. -
For k=−1:
Lower bound = 11; upper bound = 76.
Count = 76−11+1=66. -
For k=0:
Lower bound = 0; upper bound = min(76,142)=76.
Count = 76−0+1=77. -
For k=1, 2, 3, 4, 5, 6:
For k≥1, note that −11k≤0 so lower bound = 0.
Upper bound = 142−11k. For k=1 to 6, we have:142−11≥131, 142−22≥120, 142−33≥109, 142−44≥98, 142−55≥87, 142−66=76.
In each case the upper bound is at least 76, so a runs from 0 to 76.
Count for each = 76−0+1=77.
Now summing counts:
- Sum for k=−6 to −1: 11+22+33+44+55+66=231.
- For k=0: 77.
- For k=1 to 6: 6×77=462.
Total number of solutions:
231+77+462=770.
Since x runs modulo lcm(77,143)=1001, every residue in {0,1,2,…,1000} is reached exactly once. Thus, there are 770 values of 1≤k≤1001 for which 0≤f(k)≤70.