#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
int d1[4][2] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};
int d2[8][2] = {{1, 0}, {0, 1},  {0, -1}, {-1, 0},
                {1, 1}, {-1, 1}, {1, -1}, {-1, -1}};
int tree[1000001];
int sum(int id) {
  int sum = 0;
  while (id > 0) {
    sum += tree[id];
    id -= (id & (-id));
  }
  return sum;
}
int sum(int l, int r) { return sum(r) - sum(l - 1); }
void upd(int id, int val) {
  while (id <= 1000000) {
    tree[id] += val;
    id += (id & (-id));
  }
}
int korsum(int l, int r) {
  if (r < l) {
    return sum(1, r) + sum(l, 1000000);
  }
  return sum(l, r);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  if (k > n / 2) {
    k = n - k;
  }
  int curr = 1;
  long long ans = 1;
  for (int i = 0; i < n; ++i) {
    int bef = curr;
    curr = (curr + k - 1) % n + 1;
    ans += 1 + korsum((bef) % n + 1, (curr - 2 + n) % n + 1) +
           korsum((bef - (k - 1) - 1 + n) % n + 1, (bef - 2 + n) % n + 1);
    cout << ans << " ";
    upd(bef, 1);
  }
  cout << "\n";
  return 0;
}
