#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
void print() {}
template <class H, class... T>
void print(H&& h, T&&... t) {
  cout << h << " \n"[sizeof...(t) == 0];
  print(forward<T>(t)...);
}
struct Integer {
 public:
  ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
  ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
  bool isPrime(ll x) {
    if (x < 2) return false;
    if (x == 2) return true;
    if (x % 2 == 0) return false;
    for (ll i = 3; i <= sqrt(x) + 1; i += 2)
      if (x % i == 0) return false;
    return true;
  }
  vector<ll> divisor(ll M) {
    vector<ll> dd;
    for (ll i = 1; i * i <= M; i++) {
      if (M % i == 0) {
        dd.push_back(i);
        if (i * i != M) dd.push_back(M / i);
      }
    }
    sort(dd.begin(), dd.end());
    return dd;
  }
  vector<ll> factor(ll M) {
    vector<ll> dd;
    if (M == 1) {
      dd.push_back(1);
      return dd;
    }
    for (ll i = 2; i * i <= M; i++) {
      while (M % i == 0) {
        dd.push_back(i);
        M /= i;
      }
    }
    if (M != 1) dd.push_back(M);
    sort(dd.begin(), dd.end());
    return dd;
  }
};
ll l[300010], r[300010];
set<ll> ans[300010];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N, M;
  cin >> N >> M;
  for (ll i = (0); i < (N); i++) cin >> l[i] >> r[i];
  ll cnt = 0;
  Integer it;
  for (ll i = (1); i < (M + 1); i++) {
    vector<ll> dd = it.divisor(i);
    for (ll j = (0); j < (N); j++) {
      if (i >= l[j] && i <= r[j]) {
        for (auto& e : dd) {
          ans[e].insert(j);
        }
      }
    }
  }
  for (ll i = (1); i < (M + 1); i++) {
    print(ans[i].size());
  }
}
