#include <bits/stdc++.h>
using namespace std;
int t, l, r;
long long f[5000010], num = 1, ans;
int main() {
  scanf("%d%d%d", &t, &l, &r);
  for (int i = 2; i <= r; i++) f[i] = ((long long)i * (i - 1) >> 1);
  for (int i = 2; i <= r; ++i)
    for (int j = i + i, k = 2; j <= r; j += i, k++)
      f[j] = min(f[j], f[i] * k + f[k]);
  for (int i = l; i <= r; i++) {
    f[i] = f[i] % 1000000007;
    ans = ans + (num * f[i] % 1000000007);
    if (ans >= 1000000007) ans -= 1000000007;
    num = (num * t) % 1000000007;
  }
  printf("%d\n", ans);
  return 0;
}
