#include <bits/stdc++.h>
using namespace std;
vector<int> primes;
long long aux[5000100], l, r, t, ans, mod = 1000000007, halp;
bool gud;
void esprimo(int x) {
  for (int i = 0; primes[i] <= sqrt(x); i++)
    if (x % primes[i] == 0) return;
  primes.push_back(x);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  primes.push_back(2);
  for (int i = 3; i <= 2237; i += 2) esprimo(i);
  cin >> t >> l >> r;
  for (long long i = 2, z = 1; i <= r; i++) {
    gud = 1;
    halp = sqrt(i);
    for (long long j = 0; primes[j] <= halp; j++)
      if (i % primes[j] == 0) {
        gud = 0;
        aux[i] =
            ((aux[primes[j]] * (i / primes[j])) + aux[i / primes[j]]) % mod;
        j = primes.size() - 2;
      }
    if (gud) aux[i] = ((i * (i - 1)) / 2) % mod;
    if (i >= l) ans = (ans + (z * aux[i])) % mod, z = (z * t) % mod;
  }
  cout << ans;
}
