#include <bits/stdc++.h>
int dr[] = {2, 2, -2, -2, 1, -1, 1, -1};
int dc[] = {1, -1, 1, -1, 2, 2, -2, -2};
int dr1[] = {0, 0, 0, 1, 1, 1, -1, -1, -1};
int dc1[] = {-1, 0, 1, -1, 0, 1, -1, 0, 1};
int dr2[] = {0, 0, 1, -1};
int dc2[] = {1, -1, 0, 0};
using namespace std;
vector<long long int> prim;
long long int dp[5000005], mark[5000005];
long long int com(long long int x) {
  long long int p = x * (x - 1);
  return p /= 2;
}
void sieve() {
  long long int i, j;
  for (i = 3; i < 5000005; i += 2) mark[i] = i;
  for (i = 3; i <= sqrt(5000005); i += 2) {
    if (mark[i] == i) {
      for (j = i + i; j < 5000005; j += i) mark[j] = -1;
    }
  }
  prim.push_back(2);
  for (i = 3; i < 5000005; i += 2) prim.push_back(i);
}
long long int tp[5000005];
int main() {
  long long int i, j, t, l, r;
  sieve();
  while (cin >> t >> l >> r) {
    dp[1] = 0;
    dp[2] = 1;
    for (i = 3; i <= r; i++) {
      if (mark[i] == i) {
        dp[i] = com(i);
        continue;
      }
      for (j = 0; j < prim.size() && prim[j] <= sqrt(i); j++) {
        if (i % prim[j] == 0) {
          long long int p = prim[j];
          long long int p1 = i / p;
          long long int r = com(p);
          dp[i] = r * p1 + dp[p1];
          break;
        }
      }
    }
    long long int s = 0;
    long long int m = 1;
    tp[0] = 1;
    for (i = 1; i <= r; i++) {
      tp[i] = (tp[i - 1] % 1000000007 * t % 1000000007) % 1000000007;
    }
    for (i = l; i <= r; i++) {
      long long int p = (dp[i] % 1000000007 * tp[i - l]) % 1000000007;
      s += p;
      s %= 1000000007;
    }
    cout << s << endl;
  }
  return 0;
}
