아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Factorial Factors

시간 제한1초메모리 제한1024 MB

요약
A부터 B까지의 각 n에 대해 n이 m!을 나누는 가장 작은 m을 s(n)이라 할 때, s(n)의 합을 구한다.
난이도

보통10점 중 7점

유형
정수론, 수학, 누적 합, 그리디
정답자
아직 제출이 없습니다

문제

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

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 AA and BB, to find the sum:

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

입력

The single line of input contains two space-separated integers: AA and BB (1≤A≤B≤1,000,0001 \le A \le B \le 1\\,000\\,000).

출력

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

예제1

  1. 예제 1

    입력
    5 10
    
    예상 출력
    30