P3708 Koishi's Math Problem

Description

Under Flandre's guidance, Koishi has become a math master, and she came up with a simple math problem. Given an integer $n$, let $\displaystyle f(x) = \sum_{i=1}^n x \bmod i$. You need to output $f(1), f(2), \ldots, f(n)$. As usual, Koishi pretends she cannot solve this problem and asks you for help.

Input Format

A positive integer $n$.

Output Format

One line containing $n$ integers $f(1), f(2), \ldots, f(n)$ separated by spaces.

Explanation/Hint

For $20\%$ of the testdata, $n \le 1000$. For $60\%$ of the testdata, $n \le 10^5$. For $100\%$ of the testdata, $1 \le n \le 10^6$. Translated by ChatGPT 5