#include <bits/stdc++.h>
using namespace std;
template <typename T>
class SegmentTree {
  using func_t = function<T(T, T)>;
  const int n;
  const T id;
  func_t merge;
  vector<T> data;
  int size(int n) {
    int res;
    for (res = 1; res < n; res <<= 1)
      ;
    return res;
  }
  T sub(int l, int r, int node, int lb, int ub) {
    if (ub <= l || r <= lb) return id;
    if (l <= lb && ub <= r) return data[node];
    return merge(sub(l, r, node * 2, lb, (lb + ub) / 2),
                 sub(l, r, node * 2 + 1, (lb + ub) / 2, ub));
  }

 public:
  SegmentTree(int n_, T id_, func_t merge_)
      : n(size(n_)), id(id_), merge(merge_), data(size(n_) * 2, id_) {}
  SegmentTree(const vector<T>& data_, T id_, func_t merge_)
      : n(size(data_.size())),
        id(id_),
        merge(merge_),
        data(size(data_.size()) * 2, id_) {
    for (int i = 0; i < data_.size(); i++) data[i + n] = data_[i];
    for (int i = n - 1; i >= 0; i--)
      data[i] = merge(data[i * 2], data[i * 2 + 1]);
  }
  void Update(int p, T val) {
    p += n;
    data[p] = val;
    while (p >>= 1) data[p] = merge(data[p * 2], data[p * 2 + 1]);
  }
  void Add(int p, int val) {
    p += n;
    data[p].insert(val);
    while (p >>= 1) data[p] = merge(data[p * 2], data[p * 2 + 1]);
  }
  T Find(int l, int r) { return sub(l, r + 1, 1, 0, n); }
};
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> res(M + 1);
  SegmentTree<set<int>> Seg(M + 1, set<int>(), [](set<int> a, set<int> b) {
    set<int> res;
    res.insert(a.begin(), a.end());
    res.insert(b.begin(), b.end());
    return res;
  });
  for (int i = 1; i <= M; i++) {
    for (int j = i; j <= M; j += i) {
      Seg.Add(j, i);
    }
  }
  for (int i = 0, l, r; i < N; i++) {
    cin >> l >> r;
    auto st = Seg.Find(l, r);
    for (int val : st) {
      res[val]++;
    }
  }
  for (int i = 1; i <= M; i++) {
    cout << res[i] << endl;
  }
  return 0;
}
