#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  int n;
  while (cin >> n, n) {
    vector<int> a;
    for (int i = 1; i < n; i++) {
      a.emplace_back(i * i % n);
    }
    sort(a.begin(), a.end());
    a.erase(unique(a.begin(), a.end()), a.end());
    vector<int> ans((n - 1) / 2 + 1);
    for (int i = 0; i < int(a.size()); i++) {
      for (int j = 0; j < int(a.size()); j++) {
        int tmp = a[j] - a[i];
        if (tmp == 0) continue;
        if (tmp < 0) tmp += n;
        if (tmp > (n - 1) / 2) tmp = n - tmp;
        ans[tmp]++;
      }
    }
    for (int i = 1; i <= (n - 1) / 2; i++) {
      cout << ans[i] << endl;
    }
  }

  return 0;
}
