#include <bits/stdc++.h>
using namespace std;
struct FenwickTree {
  int n;
  long long *a;
  FenwickTree(int n) : n(n) {
    a = new long long[n];
    for (int i = 0; i < n; i++) a[i] = 0;
  }
  void inc(int x, int v) {
    for (; x < n; x |= x + 1) a[x] += v;
  }
  long long get(int x) {
    long long res = 0;
    for (; x >= 0; x = (x & (x + 1)) - 1) res += a[x];
    return res;
  }
  long long get(int l, int r) {
    if (l <= r)
      return get(r) - get(l - 1);
    else
      return get(l, n - 1) + get(0, r);
  }
};
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  k = min(k, n - k);
  FenwickTree tree(n);
  long long v = n, e = n;
  int cur = 0;
  for (int i = 0; i < n; i++) {
    int nxt = (cur + k) % n;
    e++;
    long long intersections = tree.get((cur + 1) % n, (nxt + n - 1) % n);
    e += 2 * intersections;
    v += intersections;
    tree.inc(cur, 1);
    tree.inc(nxt, 1);
    cur = nxt;
    assert(e - v + 1 >= 0);
    printf("%lld ", e - v + 1);
  }
  puts("");
  return 0;
}
