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];

        this.SetDic(100000);

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

        for (int i = 0; i < miyageCount; i++)
        {
            inpt = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();
            List<int> tmp = this.GetList(inpt[0], inpt[1]);
            tmp.ForEach(a => ekiMiyage[a]++);
        }

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

    List<int>[] dic;

    Dictionary<int, Dictionary<int, List<int>>> dic2 = new Dictionary<int, Dictionary<int, List<int>>>();
    private List<int> GetList(int fromNum, int toNum)
    {

        if (!dic2.ContainsKey(fromNum))
        {
            dic2.Add(fromNum, new Dictionary<int, List<int>>());
        }
        if (dic2[fromNum].ContainsKey(toNum))
        {
            return dic2[fromNum][toNum];
        }
        List<int> tmp = new List<int>();
        if (fromNum == toNum)
        {   
            tmp.AddRange(dic[fromNum]);
            tmp.Add(1);
            dic2[fromNum][toNum] = tmp;
            return tmp;
        }

        tmp.AddRange(GetList(fromNum + 1, toNum));
        tmp = tmp.Union(dic[fromNum]).ToList();
        dic2[fromNum][toNum] = tmp;
        return tmp;
    }

    private void SetDic(int max)
    {
        List<int>[] dic = new List<int>[max + 1];
        dic[1] = new List<int>();
        for (int i = 2; i <= max; i++)
        {
            if (dic[i] == null)
            {
                dic[i] = new List<int>();
            }
            for (int j = i; j <= max; j += i)
            {
                if (dic[j] == null)
                {
                    dic[j] = new List<int>();
                }
                dic[j].Add(i);
            }
        }
        this.dic = dic;
    }


    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();
    }
}