#include <bits/stdc++.h>
using namespace std;
vector<bool> is_prime;
vector<int> primes;
vector<set<int>> factors;
template <class T>
void show(T t) {
  for (auto e : t) {
    cout << e << " ";
  }
  cout << endl;
}
void make_primes(int maxi) {
  is_prime.assign(maxi + 1, true);
  is_prime[0] = false;
  is_prime[1] = false;
  for (int i = 2; i * i <= maxi; i++) {
    if (!is_prime[i]) {
      continue;
    }
    for (int j = i * 2; j <= maxi; j += i) {
      is_prime[j] = false;
    }
  }
  for (int i = 0; i <= maxi; i++) {
    if (is_prime[i]) {
      primes.emplace_back(i);
    }
  }
}
void make_factors(int maxi) {
  factors.assign(maxi + 1, set<int>());
  for (int i = 1; i <= maxi; i++) {
    set<int> fact;
    vector<int> p_factors;
    int n = i;
    int idx = 0;
    while (n > 1) {
      if (n % primes[idx] == 0) {
        n /= primes[idx];
        p_factors.emplace_back(primes[idx]);
      } else {
        idx++;
      }
    }
    int n_bit = p_factors.size();
    for (int j = (1 << n_bit) - 1; j >= 0; j--) {
      int num = 1;
      for (int k = 0; k < n_bit; k++) {
        if ((j >> k) % 2 == 1) {
          num *= p_factors[k];
        }
      }
      fact.insert(num);
    }
    factors[i] = fact;
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> l(n), r(n);
  for (int i = 0; i < n; i++) {
    cin >> l[i] >> r[i];
  }
  make_primes(m);
  make_factors(m);
  vector<int> ans(m + 1, 0);
  for (int i = 0; i < n; i++) {
    set<int> tmp;
    for (int j = l[i]; j <= r[i]; j++) {
      tmp.insert(factors[j].begin(), factors[j].end());
    }
    for (auto e : tmp) {
      ans[e]++;
    }
  }
  for (int i = 1; i <= m; i++) {
    printf("%d\n", ans[i]);
  }
  return 0;
}
