// Online compiler C++ #include using namespace std ; #define nl "\n" #define int long long using vi = vector ; void solve() { int a , b ; cin >> a >> b ; int res = 0 ; for( int i = a ; i <= b ; i++ ) { int temp = i ; if( temp != 2 && temp % 2 == 0 ) continue ; else if( temp == 1 ) continue ; bool f = true ; for( int j = 2 ; j * j <= i ; j++ ) { if( i % j == 0 ) { f = false ; break ; } } if( f ) res += pow( i , 3 ) - pow( i , 2 ) + i + 1 ; } cout << res << nl ; } signed main() { int t = 1 ; // cin >> t ; while( t-- ) { solve() ; } return 0 ; }