#include <bits/stdc++.h>
int N, M;
const int MAX_N = 100000;
int n;
std::unordered_set<int> dat[2 * MAX_N - 1];
void init(int n_) {
  n = 1;
  while (n < n_) n *= 2;
}
void update(int k, int a) {
  k += n - 1;
  dat[k].insert(a);
  while (k > 0) {
    k = (k - 1) / 2;
    dat[k].insert(a);
  }
}
std::unordered_set<int> query(int a, int b, int k = 0, int l = 0, int r = n) {
  std::unordered_set<int> res;
  if (r <= a || b <= l) return res;
  if (a <= l && r <= b)
    return dat[k];
  else {
    auto vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
    auto vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
    if (vl.size() < vr.size()) {
      for (auto& i : vl) {
        vr.insert(i);
      }
      return vr;
    } else {
      for (auto& i : vr) {
        vl.insert(i);
      }
      return vl;
    }
  }
}
int count[1000000];
int main() {
  using std::endl;
  std::cin.sync_with_stdio(false);
  std::cout.sync_with_stdio(false);
  std::cin >> N >> M;
  init(M + 1);
  for (int i = 1; i <= M; ++i) {
    for (int p = i; p <= M; p += i) {
      update(p, i);
    }
  }
  for (int i = 0; i < N; ++i) {
    int l, r;
    std::cin >> l >> r;
    for (auto& x : query(l, r + 1)) {
      ++count[x];
    }
  }
  for (int p = 1; p <= M; ++p) {
    std::cout << count[p] << std::endl;
  }
  return 0;
}
