#P2424. Sum of Divisor Sums

    ID: 15695 Type: Default 1000ms 256MiB

Sum of Divisor Sums

Sum of Divisor Sums

Given two positive integers (X) and (Y) (with (X < Y)), let (f(X)) denote the sum of all divisors of (X), i.e., [ f(X) = \sum_{d|X} d ] Your task is to compute: [ S = f(X) + f(X+1) + \cdots + f(Y)] For example, for (X=2) and (Y=5):

  • (f(2)=1+2=3)
  • (f(3)=1+3=4)
  • (f(4)=1+2+4=7)
  • (f(5)=1+5=6) Thus, (S=3+4+7+6=20).

inputFormat

The input consists of two positive integers (X) and (Y) ((X < Y)) separated by a space.

outputFormat

Output a single integer representing the value of (f(X) + f(X+1) + \cdots + f(Y)).

sample

1 2
4