#include <bits/stdc++.h>
using namespace std;
int main() {
  using BS = bitset<300000>;
  int N, M;
  cin >> N >> M;
  vector<BS> A(M + 2);
  for (int i = 0; i < N; i++) {
    int l, r;
    cin >> l >> r;
    A[l].set(i, true);
    A[r + 1].set(i, true);
  }
  BS b = A[0];
  for (int i = 1; i < M + 1; i++) {
    A[i] = (b ^= A[i]);
  }
  cout << N << '\n';
  for (int i = 2; i < M + 1; i++) {
    BS b;
    for (int j = i; j < M + 1; j += i) {
      b |= A[j];
    }
    cout << b.count() << '\n';
  }
  return 0;
}
