#include <bits/stdc++.h>
using namespace std;
int xcomp(vector<long long int>& a, vector<long long int>& b) {
  return a[0] < b[0];
}
long long int mod = 1000000007;
int main() {
  long long int N, M;
  cin >> N >> M;
  vector<long long int> a(M + 1, 0);
  vector<long long int> prime = {2};
  for (int i = 3; i <= M; ++i) {
    for (long long int j = (0); j < (prime.size()); ++j) {
      if (i % j == 0) {
        goto gomi;
      }
    }
    prime.push_back(i);
  gomi:;
  }
  for (long long int i = (0); i < (N); ++i) {
    long long int l, r;
    cin >> l >> r;
    for (long long int j = (0); j < (r); ++j) {
      long long int jj = j + 1;
      if (r - l + 1 >= jj) {
        a[jj]++;
      } else {
        if (r / jj != l / jj) {
          a[jj]++;
        } else {
          if (r % jj == 0 || l % jj == 0) {
            a[jj]++;
          }
        }
      }
    }
  }
  for (long long int i = (0); i < (M); ++i) {
    cout << a[i + 1] << endl;
  }
}
