#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x;
  char c;
  while ((c = getchar()) < '0' || c > '9')
    ;
  for (x = c - '0'; (c = getchar()) >= '0' && c <= '9';) x = x * 10 + c - '0';
  return x;
}
struct work {
  int t, l, r;
} w[1600000 + 5];
bool cmp(const work& a, const work& b) {
  return a.r != b.r ? a.r < b.r : a.t > b.t;
}
int ans[100000 + 5], wn, t[131072 * 2 + 5];
void inc(int k) {
  for (k += 131072; k; k >>= 1) ++t[k];
}
int query(int l, int r) {
  int res = 0;
  for (l += 131072 - 1, r += 131072 + 1; l ^ r ^ 1; l >>= 1, r >>= 1) {
    if (~l & 1) res += t[l + 1];
    if (r & 1) res += t[r - 1];
  }
  return res;
}
int main() {
  int n, m, i, j;
  m = read();
  n = read();
  for (i = 1; i <= n; ++i) w[++wn].l = read(), w[wn].r = read();
  for (i = 1; i <= m; ++i)
    for (j = 0; j < m; j += i) w[++wn] = (work){1, i, j + i};
  sort(w + 1, w + wn + 1, cmp);
  for (i = 1; i <= wn; ++i)
    if (w[i].t)
      ans[w[i].l] += query(w[i].r - w[i].l + 1, 100000);
    else
      inc(w[i].l);
  for (i = 1; i <= m; ++i) printf("%d\n", n - ans[i]);
}
