Sanggeun gave his son the following problem.
Two integers n1 and n2 satisfy 1≤n1<n2≤104. Let N∗ be the set of positive integers and define p:N∗→N∗ by p(n)=2n for every n∈N∗. This function defines the set S.
S(n1,n2)={p(p(n))+1∣n1≤n≤n2}
The set of pairs built from the elements of S is defined as well.
T(n1,n2)={(m1,m2)∣m1,m2∈S(n1,n2), m1<m2}
Now define the value
R(n1,n2)=∑(m1,m2)∈T(n1,n2)gcd(m1,m2)
where gcd(m1,m2) is the greatest common divisor of m1 and m2.
Given n1 and n2, write a program that computes R(n1,n2).
The first line contains two integers n1 and n2 separated by a space. (1≤n1<n2≤104)
Print the value of R(n1,n2) on the first line.