#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int Need = 100; vector prime(Need+1,true); prime.at(0) = false; prime.at(1) = false; for(int i=2; i*i<=Need; i++){ if(!prime.at(i)) continue; for(int k=i*i; k<=Need; k+=i) prime.at(k) = false; } int A,B; cin >> A >> B; int answer = 0; for(int i=A; i<=B; i++) if(prime.at(i)) answer += i*i*i-i*i+i+1; cout << answer << endl; }