#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vb = vector<bool>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vvvl = vector<vvl>;
using vd = vector<double>;
using vvd = vector<vd>;
using vvvd = vector<vvd>;
using vpii = vector<pii>;
using vvpii = vector<vpii>;
using vvvpii = vector<vvpii>;
template <typename T>
T read() {
  T t;
  cin >> t;
  return t;
}
template <class T, class U>
ostream& operator<<(ostream& o, const pair<T, U>& p) {
  return o << '(' << p.first << ", " << p.second << ')';
}
template <class T>
ostream& operator<<(ostream& o, const vector<T>& t) {
  o << "{";
  for (int i = int(0); i < int(((int)(t).size())); ++i) o << t[i] << ",";
  o << "}";
  return o;
}
vector<string> __split(const string& s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return move(v);
}
void e_r_r(vector<string>::iterator it) {}
template <typename T, typename... Args>
void e_r_r(vector<string>::iterator it, T a, Args... args) {
  if (*it == " 1" || *it == "1")
    cerr << endl;
  else
    cerr << it->substr((*it)[0] == ' ', it->length()) << " = " << a << ", ";
  e_r_r(++it, args...);
}
template <typename T>
void divisors(T n, set<T>& ret) {
  for (T i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      ret.insert(i);
      if (i * i != n) ret.insert(n / i);
    }
  }
}
template <class V>
struct SegTree0 {
  static V comp(const V& l, const V& r) {
    set<int> ret;
    for (auto&& a : l) ret.insert(a);
    for (auto&& a : r) ret.insert(a);
    return ret;
  };
  const V def = set<int>();
  const int n;
  vector<V> val;
  SegTree0(int _n) : n(p2(_n)), val(n * 2, def) {}
  void reinit() { val.fill(def); }
  V getval(int a, int b) { return getval(a, b, 0, 0, n); }
  void update(int i, V v) {
    i += n - 1;
    val[i] = v;
    while (i > 0) {
      i = (i - 1) / 2;
      val[i] = comp(val[i * 2 + 1], val[i * 2 + 2]);
    }
  }

 private:
  V getval(int a, int b, int k, int l, int r) {
    if (r <= a || b <= l) return def;
    if (a <= l && r <= b) return val[k];
    return comp(getval(a, b, k * 2 + 1, l, (l + r) / 2),
                getval(a, b, k * 2 + 2, (l + r) / 2, r));
  }
  static int p2(int n, int m = 1) { return m >= n ? m : p2(n, m * 2); }
};
void Main() {
  int n = read<int>();
  int m = read<int>();
  vpii LR(n);
  for (int i = int(0); i < int(n); ++i) {
    LR[i].first = read<int>();
    LR[i].second = read<int>() + 1;
  }
  SegTree0<set<int>> seg(m + 1);
  for (int x = int(1); x < int(m + 1); ++x) {
    set<int> s;
    divisors(x, s);
    seg.update(x, s);
  }
  vi imos(m + 10);
  vi ans(m + 1);
  for (auto&& lr : LR) {
    int l = lr.first;
    int r = lr.second;
    set<int> trains = seg.getval(l, r);
    for (auto&& t : trains) {
      if (t < l || t > r) ans[t]++;
    }
    imos[l]++;
    imos[r]--;
  }
  for (int i = int(0); i < int(m + 1); ++i) imos[i + 1] += imos[i];
  (void)printf("%d\n", n);
  for (int i = int(2); i < int(m + 1); ++i) {
    (void)printf("%d\n", ans[i] + imos[i]);
  }
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  Main();
  return 0;
}
