| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 4 초 | 2048 MB | 12 | 0 | 0 | 0.000% |
Consider numbers in base $b$ where all digits are equal to $a$ with $1 \leq a < b$. We call a triple $(n, a, b)$ an infinity triple if infinitely many of those numbers are divisible by $n$.
For example, $(3, 9, 10)$ is an infinity triple because infinitely many of the numbers $9$, $99$, $999$, $\ldots$ are divisible by $3$. The triple $(7, 9, 10)$ is also an infinity triple, but $(5, 9, 10)$ is not.
Given $m$, count the number of infinity triples with $1 \leq n \leq m$ and $1 \leq a < b \leq m$.
The input contains one integer $m$ ($2 \leq m \leq 10^5$).
Output one integer, the number of infinity triples with $1 \leq n \leq m$ and $1 \leq a < b \leq m$.
2
1
3
6
42
25055
In the first sample, $(1, 1, 2)$ is the only infinity triple.
In the second sample, the infinity triples are $(1, 1, 2), (1, 1, 3), (1, 2, 3), (2, 1, 3), (2, 2, 3),$ and $(3, 1, 2)$.