#include <bits/stdc++.h>
using namespace std;
int tree[1000005];
long long ans[1000005];
int n;
int lowbit(int x) { return x & (-x); }
int sum(int x) {
  int sum = 0;
  while (x > 0) {
    sum += tree[x];
    x -= lowbit(x);
  }
  return sum;
}
void add(int x, int c) {
  while (x <= n) {
    tree[x] += c;
    x += lowbit(x);
  }
}
int main() {
  int k;
  scanf("%d%d", &n, &k);
  if (k > n / 2) {
    k = n - k;
  }
  memset(tree, 0, sizeof(tree));
  memset(ans, 0, sizeof(ans));
  int tmp = n - 1;
  long long output = 2;
  int now = 1 + k;
  add(1, 1);
  add(now, 1);
  int contz = 0;
  ans[contz++] = 2;
  while (tmp--) {
    int pre = now;
    now += k;
    if (now > n) now -= n;
    if (now > pre) {
      output += sum(now - 1) - sum(pre) + 1;
    } else {
      output += sum(n) - sum(pre) + sum(now - 1) + 1;
    }
    add(pre, 1);
    add(now, 1);
    ans[contz++] = output;
  }
  for (int i = 0; i < contz; i++) {
    printf("%I64d ", ans[i]);
  }
  printf("\n");
}
