QOJ.ac

QOJ

시간 제한: 1.0 s 메모리 제한: 32 MB 총점: 140

#16623. SNAGA

통계

让我们从一个正整数 $N$ 开始,并找到不能整除 $N$ 的最小正整数。

如果我们用得到的新数重复该过程,以此类推,最终我们一定会得到数字 2。我们定义 $\text{strength}(N)$ 为所得序列的长度。

例如,对于 $N = 6$,我们得到的序列为 6, 4, 3, 2,其中包含 4 个数,因此 $\text{strength}(6) = 4$。

给定两个正整数 $A < B$,计算介于 $A$ 和 $B$ 之间(含两端)的所有整数的强度之和,即:

$$\text{strength}(A) + \text{strength}(A + 1) + \dots + \text{strength}(B)$$

输入格式

输入的第一行也是唯一的一行包含两个正整数 $A$ 和 $B$($3 \le A < B < 10^{17}$)。

输出格式

输出的第一行也是唯一的一行应当包含所求的强度之和。

样例

输入样例 1

3 6

输出样例 1

11

输入样例 2

100 200

输出样例 2

262

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.