Under construction

Still being built. Things may change

Fear Factoring

Time limit1sMemory limit512 MB

Summary
Given a and b up to 1e12 with b-a at most 1e6, sum the divisor sums F(n) over every n in [a, b].
Level

Medium7 of 10

Topics
Number theory, Math, Implementation, Brute force
Solved
No attempts yet

Problem

The Slivians are afraid of factoring. It is, well, difficult.

They do not even care about the factors themselves, only about how much they sum to.

Define F(n)F(n) as the sum of all factors of nn, so F(6)=12F(6) = 12 and F(12)=28F(12) = 28. Given two integers aa and bb with a≤ba \le b, compute

S=∑a≤n≤bF(n)S=\sum_{a \le n \le b} F(n)

Input

The first line contains two integers aa and bb separated by a space. (1≤a≤b≤10121 \le a \le b \le 10^{12}, b−a≤106b - a \le 10^{6})

Output

Print SS on a single line.

Examples6

  1. Example 1

    Input
    101 101
    
    Expected output
    102
    
  2. Example 2

    Input
    28 28
    
    Expected output
    56
    
  3. Example 3

    Input
    1 10
    
    Expected output
    87
    
  4. Example 4

    Input
    987654456799 987654456799
    
    Expected output
    987654456800
    
  5. Example 5

    Input
    963761198400 963761198400
    
    Expected output
    5531765944320
    
  6. Example 6

    Input
    5260013877 5260489265
    
    Expected output
    4113430571304040