http://acm.hdu.edu.cn/showproblem.php?pid=2824
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
#define maxn 3000010
#define INT __int64
int Prime[ maxn + 1 ] ;
INT ans[ maxn + 1 ] ;
void enlerfun()
{
memset( ans , 0 ,sizeof( ans ) ) ;
ans[ 1 ] = 1 ;
for( int i = 2 ; i <= maxn ; ++i )
{
if( !ans[ i ] )
{
for( int j = i ; j <= maxn ; j += i )
{
if( !ans[ j ] )
ans[ j ] = j ;
ans[ j ] = ans[ j ] / i * ( i - 1 ) ;
}
}
ans[ i ] += ans[ i - 1] ;
}
}
int main()
{
int n , m;
enlerfun() ;
while( ~scanf( "%d%d" , &m ,&n ) && n )
{
printf( "%I64d\n" , ans[ n ] - ans[ m - 1]) ;
}
return 0 ;
}