#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const long long LINF = 1e18;
const double FINF = 1e15;
const double EPS = 1e-9;
const double PI = 2.0 * acos(0.0);
struct S {
  int x, y, id;
  bool operator<(const S& rhs) {
    if (x != rhs.x) return x < rhs.x;
    if (y != rhs.y) return y < rhs.y;
    return id < rhs.id;
  }
};
int T[4000005][2];
int n, k;
int sum(int x, int y, int id, int l, int r, int t) {
  y = min(y, n);
  if (y < l || r < x) return 0;
  if (x <= l && r <= y) return T[id][t];
  int m = (l + r) / 2;
  return sum(x, y, id << 1, l, m, t) + sum(x, y, id << 1 | 1, m + 1, r, t);
}
void update(int pos, int val, int id, int l, int r, int t) {
  if (l == r) {
    T[id][t] += val;
    return;
  }
  int m = (l + r) / 2;
  if (pos <= m) {
    update(pos, val, id << 1, l, m, t);
  } else {
    update(pos, val, id << 1 | 1, m + 1, r, t);
  }
  T[id][t] = T[id << 1][t] + T[id << 1 | 1][t];
}
int main() {
  scanf("%d %d", &n, &k);
  int cur = 0;
  long long acc = 1;
  int a = max(k, n - k);
  int b = n - a;
  for (int i = 0; i < n; ++i) {
    int x = cur;
    int y = (cur + k) % n;
    cur = y;
    if (x > y) swap(x, y);
    ++acc;
    int diff = abs(y - x);
    if (diff == a) {
      acc += sum(x + 1, x + b - 1, 1, 0, n, 1);
      acc += sum(y + 1, y + b - 1, 1, 0, n, 1);
      acc += sum(x + 1, y + a - 1, 1, 0, n, 0);
      update(y, 1, 1, 0, n, 0);
    } else {
      acc += sum(x + 1, y - 1, 1, 0, n, 0);
      acc += sum(x + a + 1, y + a - 1, 1, 0, n, 0);
      acc += sum(x + 1, y + b - 1, 1, 0, n, 1);
      update(y, 1, 1, 0, n, 1);
    }
    printf("%lld ", acc);
  }
  puts("");
}
