#include <bits/stdc++.h>
using namespace std;
long long int d[1000005];
long long int st[4000020];
long long int n, k, vrt1, vrt2, ans;
long long int middle(long long int se, long long int ss) {
  return (ss + se) / 2;
}
long long int sum_recur(long long int ss, long long int se, long long int qs,
                        long long int qe, long long int si) {
  if (ss >= qs && se <= qe) return st[si];
  if (se < qs || ss > qe) return 0;
  long long int mid = middle(ss, se);
  return sum_recur(ss, mid, qs, qe, 2 * si + 1) +
         sum_recur(mid + 1, se, qs, qe, 2 * si + 2);
}
void update_recur(long long int ss, long long int se, long long int i,
                  long long int si) {
  if (i < ss || i > se) return;
  st[si] += 1;
  if (ss != se) {
    long long int mid = middle(ss, se);
    update_recur(ss, mid, i, si * 2 + 1);
    update_recur(mid + 1, se, i, si * 2 + 2);
    return;
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  ;
  cin >> n >> k;
  if (k > n / 2) k = n - k;
  vrt1 = 0;
  ans = 1;
  for (long long int i = 1; i <= n; i++) {
    vrt2 = (vrt1 + k) % n;
    if (vrt1 < vrt2) {
      ans += sum_recur(0, n - 1, vrt1, vrt2, 0) - d[vrt1] - d[vrt2];
    } else {
      ans += sum_recur(0, n - 1, vrt1, n - 1, 0) +
             sum_recur(0, n - 1, 0, vrt2, 0) - d[vrt1] - d[vrt2];
    }
    d[vrt1]++;
    d[vrt2]++;
    update_recur(0, n - 1, vrt1, 0);
    update_recur(0, n - 1, vrt2, 0);
    vrt1 = vrt2;
    ans++;
    cout << ans << " ";
  }
  cout << endl;
  return 0;
}
