#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; inline bool is_prime(int x) { for (int i = 2; i * i <= x; ++i) { if (x % i == 0) return false; } return true; } inline int f(int x) { return x * x * x - x * x + x + 1; } int main() { cin.tie(nullptr)->sync_with_stdio(false); int a, b; cin >> a >> b; int ans = 0; for (int x = a; x <= b; ++x) if (is_prime(x)) ans += f(x); cout << ans << '\n'; return 0; }