#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

#define rep(i, n) for (int i = 0; i < int(n); ++i)

int main() {
  int n, c[10000];
  while (true) {
    cin >> n;
    if (n == 0) break;
    vector<int> a;
    rep (i, n - 1) a.push_back((i + 1) * (i + 1) % n);
    sort(a.begin(), a.end());
    a.erase(unique(a.begin(), a.end()), a.end());
    rep (i, n) c[i] = 0;
    rep (i, a.size()) rep (j, a.size()) if (i != j) {
      int k = a[i] - a[j];
      if (k < 0) k += n;
      if (k > (n - 1) / 2) k = n - k;
      ++c[k];
    }
    rep (i, (n - 1) / 2) cout << c[i + 1] << endl;
  }
}