Snaga
의견: 0
\(1^{st}\) round, October \(20^{th}\), 2012
Let us begin with a positive integer N and find the smallest positive integer which doesn't divide N.
If we repeat the procedure with the resulting number, then again with the new result and so on, we will
eventually obtain the number 2 (two). Let us define strength(N) as the length of the resulting
sequence.
For example, for \(N = 6\) we obtain the sequence 6, 4, 3, 2 which consists of 4 numbers, thus strength(6)
= 4.
Given two positive integers \(A < B\), calculate the sum of strengths of all integers between A and B
(inclusive), that is,
strength(A) + strength(\(A + 1\)) + ... + strength(B).
The first and only line of input contains two positive integers, A and B (\(3 \le A < B < 10^{17}\)).
The first and only line of output should contain the requested sum of strengths.
3 611100 200262평가 및 의견
Snaga
Log in to rate problems.
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Snaga