#include <bits/stdc++.h>
using namespace std;
long long M = 1e9 + 7;
bool vis[5000005];
int sp[5000005];
vector<int> primes;
long long nc2(long long x) { return (x * (x - 1) / 2) % M; }
long long modexp(long long a, long long b) {
  if (b == 0) return 1;
  long long temp = modexp(a, b / 2);
  temp = (temp * temp) % M;
  if (b % 2 == 0)
    return temp;
  else
    return (temp * a) % M;
}
void sieve() {
  vis[0] = vis[1] = 1;
  for (int i = 2; i <= 5000005; i++) {
    if (!vis[i]) {
      primes.push_back(i);
      sp[i] = i;
      int cur = i + i;
      while (cur <= 5000005) {
        vis[cur] = 1;
        if (!sp[cur]) sp[cur] = i;
        cur += i;
      }
    }
  }
}
long long solve(int num) {
  long long ret = 0;
  while (num > 1) {
    ret = (ret + (nc2(sp[num]) * (num / sp[num])) % M) % M;
    num /= sp[num];
  }
  return ret;
}
int main() {
  sieve();
  long long t, l, r, f, s, ans = 0;
  scanf("%lld%lld%lld", &t, &l, &r);
  for (int i = 0; i < r - l + 1; i++) {
    if (i == 0)
      f = 1;
    else
      f = (f * t) % M;
    s = solve(l + i);
    ans = (ans + (f * s) % M) % M;
  }
  printf("%lld\n", ans);
  return 0;
}
