#include <algorithm>
#include <cstring>
#include <cstdio>
#include <set>
#include <vector>

using namespace std;

int n, results[5000], remsv[10000], squares[10000];
set<int> remss;

int main() {
  for (int i = 1; i < 10000; i++)
    squares[i] = i * i;
  for (;;) {
    scanf("%i", &n);
    if (!n) return 0;
    memset(results, 0, sizeof results);
    remss.clear();
    memset(remsv, 0, sizeof remsv);
    for (int i = 1; i < n; i++)
      remss.insert(squares[i] % n);
    copy(remss.begin(), remss.end(), remsv);
    for (int i = 0; i < remss.size()-1; i++)
      for (int j = i+1; j < remss.size(); j++) {
        int d = remsv[i] - remsv[j];
        if (d < 0) d += n;
        if (d > n / 2) d = n - d;
        results[d]++;
      }
    for (int i = 1; i <= n / 2; i++)
      printf("%d\n", results[i] * 2);
  }
}