Problem

Source: Chinese Southeast Mathematical Olympiad

Tags: modular arithmetic, number theory



For any positive integer $n$, let $D_n$ denote the set of all positive divisors of $n$, and let $f_i(n)$ denote the size of the set $$F_i(n) = \{a \in D_n | a \equiv i \pmod{4} \}$$where $i = 1, 2$. Determine the smallest positive integer $m$ such that $2f_1(m) - f_2(m) = 2017$.