#include <bits/stdc++.h>
using namespace std;
const int MX = 1e7;
long long mnf[MX], mod = 1e9 + 7;
int prime[MX];
long long dp[MX];
long long store(long long val) {
  if (dp[val] != -1) return dp[val] % mod;
  if (!prime[val]) return dp[val] = (val * (val - 1LL) / 2LL) % mod;
  return dp[val] =
             (val / prime[val] * store(prime[val]) + store(val / prime[val])) %
             mod;
}
int main() {
  for (int i = 2; i < MX; ++i) {
    if (!prime[i])
      for (int j = 2 * i; j < MX; j += i) {
        if (!prime[j]) prime[j] = i;
      }
  }
  long long t, l, h;
  cin >> t >> l >> h;
  memset(dp, -1, sizeof(dp));
  long long acc = 1, sum = 0;
  for (int k = l; k <= h; ++k) {
    store(k);
    sum = (sum + (acc * dp[k])) % mod;
    acc = (acc * t) % mod;
  }
  cout << sum << endl;
  return 0;
}
