#include <iostream>
#include <ccomplex>
#include <vector>
#include <cassert>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <numeric>
#include <list>
#include <assert.h>
#include <math.h>
#include <valarray>
#include <stdio.h>
#include <algorithm>
#include <set>
#include <complex>
#include <list>
#include <time.h>
#include <stack>
#include <locale>
#include <clocale>
#include <ctype.h>
#include <wchar.h>

using namespace std;
typedef long long int LL;
typedef pair<long long int, long long int> pii;
typedef pair<double, double> pdd;

#define SORT(c) sort((c).begin(),(c).end())
#define BACKSORT(c) sort((c).begin(),(c).end(),std::greater<LL>())
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

int xcomp(vector<LL>& a, vector<LL>& b) {
	return a[0] < b[0];
}

#define XSORT(c) sort((c).begin(),(c).end(),xcomp)

#define ALL(x) (x).begin(),(x).end()
LL mod = 1000000007;


int main() {
	LL N, M;
	cin >> N >> M;
	vector<LL> a(M+1,0);
	vector<LL> prime = { 2 };
	for (int i = 3; i <= M; ++i) {
		REP(j, prime.size()) {
			if (i%j == 0) {
				goto gomi;
			}

		}
		prime.push_back(i);
	gomi:

	}

	REP(i, N) {
		LL l, r;
		cin >> l >> r;
		REP(j, r) {
			LL 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]++;
					}
				}
			}
		}
	}
	REP(i, M) {
		cout << a[i + 1] << endl;
	}
}
