Logo
(追記) (追記ここまで)

30004번 - Factorial Factors 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB28141152.381%

문제

For any positive integer $n,ドル define $s(n)$ as the smallest positive integer $m,ドル whose factorial\footnote{The factorial of a positive integer $m$ (denoted as $m!$) is the product of all integers from 1 to $m$: $$ m! := 1\cdot 2 \cdot 3 \cdot \ldots \cdot m. $$ is divisible by $n$.

For example, $$\begin{align*} s(1) &= 1,\\ s(2) &= 2,\quad \text{(because 1ドル!$ (=1) is not divisible by 2, but 2ドル!$ (=2) is)}\\ s(4) &= 4,\quad \text{(3ドル!$ (=6) is not divisible by 4, but 4ドル!$ (=24) is)}\\ s(6) &= 3,\quad \text{(3ドル!$ (=6) is divisible by 6)}\\ s(9) &= 6,\quad \text{(6ドル!$ (=720) is divisible by 9)}\\ s(10) &= 5,\quad \text{etc}\\ \end{align*}$$

The task is, given two integers $A$ and $B,ドル to find the sum:

$$s(A) + s(A+1) + \ldots + s(B).$$

입력

The single line of input contains two space-separated integers: $A$ and $B$ (1ドル \le A \le B \le 1,000円,000円$).

출력

The first and only line of output should contain the required sum.

제한

예제 입력 1

5 10

예제 출력 1

30

The answer is $s(5) + s(6) + s(7) + s(8) + s(9) + s(10) = 5 +たす 3 +たす 7 +たす 4 +たす 6 +たす 5 = 30$.

힌트

출처

Olympiad > Estonian Informatics Olympiad > 2016-17 > Open Competition 4번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /