For
k≤2n the quotient
⌊kn⌋ is at least
2, so the remainder satisfies
f(n,k)≤n−2k as well as
f(n,k)≤k−1. Write
n=3m+r with
r∈{0,1,2}. Dividing by
k=m+1 gives quotient
2 and remainder
m+r−2, so
F(n)≥m+r−2. Conversely, for
k≥m+1, f(n,k)≤n−2k≤m+r−2, and for smaller
k the bound
f(n,k)≤k−1 finishes the job: when
r=2 it gives at most
m for
k≤m+1; when
r=1 it gives at most
m−1 for
k≤m; and when
r=0 it gives at most
m−2 for
k≤m−1, while
k=m divides
3m exactly, leaving remainder
0. Hence
F(3m)F(3m+1)F(3m+2)=m−2,=m−1,=m.
Grouping
n=20,…,100 as triples
3m−1, 3m, 3m+1 for
m=7,…,33 (note
F(3m−1)=F(3(m−1)+2) =m−1), each triple contributes
(m−1)+(m−2)+(m−1) =3m−4, so
n=20∑100F(n)=m=7∑33(3m−4)=3⋅2(7+33)⋅27−4⋅27=1620−108=1512.
The requested remainder is
512.