#include <bits/stdc++.h>
using namespace std;
int n;
unsigned long long ft[2000130];
void update(int x, unsigned long long v) {
  while (x <= 2 * n + 20) {
    ft[x] += v;
    x += (x & -x);
  }
}
unsigned long long query(int x) {
  return x > 0 ? ft[x] + query(x - (x & -x)) : 0;
}
int main() {
  ios::sync_with_stdio(false);
  int k;
  cin >> n >> k;
  k = min(k, n - k);
  int curVert = 1;
  unsigned long long ans = 1;
  for (int i = 0; i < n; i++) {
    int nextVert = curVert + k;
    ans += query(nextVert - 1) - query(curVert) + 1;
    update(nextVert, 1);
    if (nextVert > n)
      update(nextVert - n, 1);
    else
      update(nextVert + n, 1);
    update(curVert, 1);
    if (curVert > n)
      update(curVert - n, 1);
    else
      update(curVert + n, 1);
    if (nextVert > n) nextVert -= n;
    curVert = nextVert;
    cout << ans << " ";
  }
}
