Solution
The Pattern
We can find that
20≡6(mod7)
21≡5(mod8)
22≡6(mod8)
23≡7(mod8)
24≡6(mod9)
25≡7(mod9)
26≡8(mod9)
Observing these and we can find that the reminders are in groups of three continuous integers, considering this is true, and we get
99≡31(mod34)
100≡32(mod34)
So the sum is 6+3×(6+...+31)+31+32=1512,it is also 17+20+23+...+95, so the answer is 512. By: Kris17
The Intuition
First, let's see what happens if we remove a restriction. Let's define G(x) as
G(x):=max1≤kf(n,k)
Now, if you set k as any number greater than n, you get n, obviously the maximum possible. That's too much freedom; let's restrict it a bit. Hence H(x) is defined as
H(x):=max1≤k≤nf(n,k)
Now, after some thought, we find that if we set k=⌊2n⌋+1 we get a remainder of ⌊2n−1⌋, the max possible. Once we have gotten this far, it is easy to see that the original equation,
F(n)=max1≤k≤2nf(n,k)
has a solution with k=⌊3n⌋+1.
W5~Rowechen
The Proof
The solution presented above does not prove why F(x) is found by dividing x by 3. Indeed, that is the case, as rigorously shown below.
Consider the case where x=3k. We shall prove that F(x)=f(x,k+1). For all x/2≥n>k+1,x=2n+q, where 0≤q<n. This is because x<3k+3<3n and x≥2n. Also, as n increases, q decreases. Thus, q=f(x,n)<f(x,k+1)=k−2 for all n>k+1. Consider all n<k+1.f(x,k)=0 and f(x,k−1)=3. Also, 0<f(x,k−2)<k−2. Thus, for k>5,f(x,k+1)>f(x,n) for n<k+1.
Similar proofs apply for x=3k+1 and x=3k+2. The reader should feel free to derive these proofs themself.
Generalized Solution
Lemma: Highest remainder when n is divided by 1≤k≤n/2 is obtained for k0=(n+(3−n(mod3)))/3 and the remainder thus obtained is (n−k0∗2)=[(n−6)/3+(2/3)∗n(mod3)].
Note: This is the second highest remainder when n is divided by 1≤k≤n and the highest remainder occurs when n is divided by kM = (n+1)/2 for odd n and kM = (n+2)/2 for even n.
Using the lemma above:
n=20∑100F(n)=n=20∑100[(n−6)/3+(2/3)∗n(mod3)] =[(120∗81/2)/3−2∗81+(2/3)∗81]=1512
So the answer is 512
Proof of Lemma: It is similar to TheProof stated above.
Kris17
Video Solution
https://youtu.be/mQ4_1dp8Wm8?si=Ae5HAc0cZQAjdtWl
~MathProblemSolvingSkills.com