#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define N (int)1e5
#define F first
#define S second
typedef pair<int, int> P;
int n, m, ans;
int l[N + 1], r[N + 1];
P lr[N + 1];
vector<int> vec[N + 10];
int bit[N + 1];
int sum(int i, int *b)
{
	int s = 0;
	while (i > 0)
	{
		s += b[i];
		i = i & (i - 1);
	}
	return s;
}
void add(int i, int x, int *b)
{
	while (i <= m)
	{
		b[i] += x;
		i += i & -i;
	}
}
int main()
{
	cin >> n >> m;
	for (int i = 0; i < n; i++)
	{
		cin >> lr[i].S >> lr[i].F;
		l[i] = lr[i].S;
		r[i] = lr[i].F;
		lr[i].F = lr[i].F - lr[i].S + 1;
	}
	sort(lr, lr + n);
	int p1 = 0, p2 = 0;
	for (int i = 1; i <= m; i++)
	{
		ans = 0;
		p2 = lower_bound(lr, lr + n, make_pair(i, 0)) - lr;
		ans = n - p2;
		for (int j = p1; j < p2; j++)
		{
		    add(lr[j].S, 1, bit);
			add(lr[j].F + lr[j].S, -1, bit);
		}
		p1 = p2;
		for (int j = 0; j <= m; j += i)
		{
			ans += sum(j , bit);