{ "problem": "For a real number $r$, let $A(r)$ denote the fractional part of $2r$ in its decimal representation. For a real number $r$ and a positive integer $n$, define $B(n,r)$ as\n $$\n B(n,r)=\\sum_{k=1}^n A(kr).\n $$\n Find all positive real numbers $r$ such that $n(n+1)r - B(n,r)$ is a multiple of $n$ for all positive integers $n$.", "solution": "Let $r$ be a positive real number. Let $A(r)$ denote the fractional part of $2r$, so $A(r) = 2r - \\lfloor 2r \\rfloor$. We are given that $B(n,r) = \\sum_{k=1}^n A(kr)$. We want to find all positive real numbers $r$ such that $n(n+1)r - B(n,r)$ is a multiple of $n$ for all positive integers $n$.\n\n We can rewrite the condition as\n $$\n n(n+1)r - \\sum_{k=1}^n (2kr - \\lfloor 2kr \\rfloor) = \\sum_{k=1}^n \\lfloor 2kr \\rfloor \\quad \\text{is a multiple of } n.\n $$\n Let $\\alpha = 2r$. Then the condition becomes: $\\sum_{k=1}^n \\lfloor k\\alpha \\rfloor$ is a multiple of $n$ for all positive integers $n$.\n\n We prove that all even integers $\\alpha$ satisfy the condition, and no other real number $\\alpha$ does so. First we will show that\n even integers satisfy the condition. If $\\alpha=2m$ where $m$ is\n an integer then\n\n \\[\n \\lfloor\\alpha\\rfloor+\\lfloor2\\alpha\\rfloor+\\cdots+\\lfloor n\\alpha\\rfloor=2m+4m+\\cdots+2mn=mn(n+1)\n \\]\n\n which is a multiple of $n$. Since $r > 0$, we must have $\\alpha = 2r > 0$. So $\\alpha$ must be a positive even integer. If $\\alpha = 2m$ for some positive integer $m$, then $r = m$, which is a positive integer.\n\n Now we will show that they are the only real numbers satisfying the\n conditions of the problem. Let $\\alpha=k+\\epsilon$ where $k$ is\n an integer and $0\\leqslant\\epsilon<1$. Then the number\n \\[\n \\begin{aligned}\\lfloor\\alpha\\rfloor+\\lfloor2\\alpha\\rfloor+\\cdots+\\lfloor n\\alpha\\rfloor & = \\lfloor k+\\epsilon \\rfloor+\\lfloor2(k+\\epsilon)\\rfloor+\\cdots+\\lfloor n(k+\\epsilon)\\rfloor\n\n & = k+\\lfloor\\epsilon\\rfloor+2k+\\lfloor2\\epsilon\\rfloor+\\cdots+nk+\\lfloor n\\epsilon\\rfloor\n\n & =\\frac{kn(n+1)}{2}+\\lfloor\\epsilon\\rfloor+\\lfloor2\\epsilon\\rfloor+\\cdots+\\lfloor n\\epsilon\\rfloor\n \\end{aligned}\n \\]\n has to be a multiple of $n$. We consider two cases based on the parity\n of $k$.\n\n\n \\begin{itemize}\n \\item Case 1: \\textbf{$k$ is even.} Then $\\frac{kn(n+1)}{2}$ is always\n a multiple of $n$. Thus\n \\[\n \\lfloor\\epsilon\\rfloor+\\lfloor2\\epsilon\\rfloor+\\cdots+\\lfloor n\\epsilon\\rfloor\n \\]\n also has to be a multiple of $n$. We will prove that $\\lfloor n\\epsilon\\rfloor=0$\n for every positive integer $n$ by strong induction. The base case\n $n=1$ follows from the fact that $0\\leqslant\\epsilon<1$. Let us\n suppose that $\\lfloor m\\epsilon\\rfloor=0$ for every $1\\leqslant m 0$, $\\alpha = 2r > 0$. So $\\alpha$ must be a positive even integer. This means $2r = 2m$ for some positive integer $m$. Therefore, $r=m$ must be a positive integer.\n \\item Case 2: \\textbf{$k$ is odd.} We will prove that $\\lfloor n\\epsilon\\rfloor=n-1$\n for every natural number $n$ by strong induction. The base case $n=1$\n again follows from the fact that $0\\leqslant\\epsilon<1$. Let us suppose\n that $\\lfloor m\\epsilon\\rfloor=m-1$ for every $1\\leqslant m