Let $f(x)=\sum_{k=2}^{10}(\lfloor kx \rfloor -k \lfloor x \rfloor)$, where $\lfloor r \rfloor$ denotes the greatest integer less than or equal to $r$. How many distinct values does $f(x)$ assume for $x \ge 0$? $\textbf{(A)}\ 32\qquad\textbf{(B)}\ 36\qquad\textbf{(C)}\ 45\qquad\textbf{(D)}\ 46\qquad\textbf{(E)}\ \text{infinitely many}$
$\lfloor kx\rfloor-k\lfloor x\rfloor=\lfloor k\{x\}\rfloor$, so $f(x)=\sum_{k=2}^{10}\lfloor k\{x\}\rfloor$ depends only on $t=\{x\}\in[0,1)$.
As $t$ increases from $0$, $f$ never decreases, and it jumps up exactly at the fractions $\frac jk$ with $2\le k\le10$, $1\le j<k$. So the number of values is $1$ plus the number of distinct such fractions.
Distinct fractions in lowest terms with denominator $k$: $\varphi(k)$ (Theorem 102), the number of integers in $1,\dots,k$ coprime to $k$ (Euler's function; see the Modular Arithmetic chapter). $\varphi(2)+\cdots+\varphi(10)=1+2+2+4+2+6+4+6+4=31$.