using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;

class Program
{
    public void Proc()
    {
        Reader.IsDebug = false;
        int[] inpt = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();

        int miyageCount = inpt[0];
        int ekiCount = inpt[1];

        int[] ekiMiyage = new int[ekiCount + 1];

        for (int i = 0; i < miyageCount; i++)
        {
            inpt = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();
            bool[] flags = new bool[ekiCount+1];
            for(int j=inpt[0]; j<=inpt[1]; j++) {
                List<int> yakusu = this.GetYakusu(j);
                foreach (int target in yakusu)
                {
                    if (flags[target])
                    {
                        continue;
                    }
                    ekiMiyage[target]++;
                    flags[target] = true;
                }
            }
        }

        StringBuilder ans = new StringBuilder();
        for (int i = 1; i < ekiMiyage.Length; i++)
        {
            ans.AppendLine(ekiMiyage[i].ToString());
        }
        Console.Write(ans.ToString());
    }

    Dictionary<int, List<int>> dic = new Dictionary<int, List<int>>();

    private List<int> GetYakusu(int num)
    {
        if (dic.ContainsKey(num))
        {
            return dic[num];
        }
        List<int> tmp = new List<int>();
        for (int i = 1; i <= Math.Sqrt(num); i++)
        {
            if (num % i == 0)
            {
                tmp.Add(i);
                tmp.Add(num / i);
            }
        }
        dic.Add(num, tmp);
        return tmp;
    }




    public class Reader
    {
        public static bool IsDebug = true;
        private static String PlainInput = @"



7 9
1 7
5 9
5 7
5 9
1 1
6 8
3 4



";
        private static System.IO.StringReader Sr = null;
        public static string ReadLine()
        {
            if (IsDebug)
            {
                if (Sr == null)
                {
                    Sr = new System.IO.StringReader(PlainInput.Trim());
                }
                return Sr.ReadLine();
            }
            else
            {
                return Console.ReadLine();
            }
        }
    }
    static void Main()
    {
        Program prg = new Program();
        prg.Proc();
    }
}