#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7, inf = 1061109567;
const long long infll = 4557430888798830399;
const int N = 3e5 + 5, M = 1e5 + 5;
int n, m;
struct Seg {
  int l, r;
} s[N];
vector<int> divi[M];
void sieve() {
  for (int i = 1; i < M; i++) {
    for (int j = i; j < M; j += i) divi[j].push_back(i);
  }
}
struct BIT {
  int t[M], n;
  void init(int _n) {
    n = _n;
    for (int i = 0; i < n + 1; i++) t[i] = 0;
  }
  void add(int pos, int val) {
    pos++;
    for (; pos <= n; pos += (pos & (-pos))) t[pos] += val;
  }
  int get(int pos) {
    pos++;
    int ans = 0;
    for (; pos > 0; pos -= (pos & (-pos))) ans += t[pos];
    return ans;
  }
  int getRange(int l, int r) {
    int ans = get(r);
    if (l > 0) ans -= get(l - 1);
    return ans;
  }
} bit;
vector<int> leBounds[M];
int ans[M];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> s[i].l >> s[i].r, s[i].l--, s[i].r--;
  bit.init(n);
  for (int i = 0; i < n; i++) {
    bit.add(s[i].l, 1);
    leBounds[s[i].r].push_back(s[i].l);
  }
  sieve();
  for (int i = 0; i < m; i++) {
    for (auto j : divi[i + 1]) {
      int lst = i - j + 1;
      ans[j] += bit.getRange(lst, i);
    }
    for (auto j : leBounds[i]) bit.add(j, -1);
  }
  for (int i = 1; i < m + 1; i++) cout << ans[i] << "\n";
  return 0;
}
