#include #include using namespace std; using namespace atcoder; #ifndef ONLINE_JUDGE #define _GLIBCXX_DEBUG #endif #define int long long using ull = unsigned long long; using ll = long long; using vi = vector; using vs = vector; using vc = vector; using vb = vector; using vd = vector; using vvi = vector; using vvvi = vector; using vvvvi = vector; #define rep(i,n) for(ll i = 0; i< (int)n; i++) #define drep(i,n) for(ll i=n; i>=0; i--) #define REP(a,b,c) for(ll a = b; a=c; a--) const ll INF = 5e18; #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define pb push_back #define eb emplace_back #define em emplace #define pob pop_back #define Yes cout << "Yes" << endl #define No cout << "No" << endl #define YES cout << "YES" << endl #define NO cout << "NO" << endl #define fail cout << -1 << endl #define YN {cout<<"Yes"< inline bool chmin(T& a, T b) {if(a>b) {a=b; return true;} else return false;} template inline bool chmax(T& a, T b) {if(a T max(vector &a) {T ans = a[0]; for(auto x : a) chmax(ans,x); return ans;} template T min(vector &a) {T ans = a[0]; for(auto x : a) chmin(ans,x); return ans;} vi DY = {1,0,-1,0,1,-1,-1,1}; vi DX = {0,1,0,-1,1,1,-1,-1}; // cout << fixed << setprecision(20); using mint = modint998244353; bool prime(int n) { bool check = true; for(int i=2; i*i<=n; i++) { if(n%i == 0) check = false; } return check; } int32_t main() { { ios::sync_with_stdio(false); cin.tie(nullptr); } int a,b; cin>>a>>b; int ans = 0; for(int i=a; i<=b; i++) { if(prime(i)) ans += i*i*i - i*i + i + 1; } cout << ans << endl; }