#include <bits/stdc++.h>
using namespace std;

bool f[10000];

int main()
{
	int n;
	while (scanf("%d", &n), n){
		memset(f, false, sizeof(f));
		for (int i = 1; i < n; i++){
			f[i * i % n] = true;
		}
		vector<int> v;
		for (int i = 0; i < n; i++){
			if (f[i]) v.push_back(i);
		}
		int cnt[10000] = {};
		for (int i = 0; i < v.size(); i++){
			for (int j = 0; j < v.size(); j++){
				if (i == j) continue;
				int x = v[i] - v[j];
				if (x < 0) x += n;
				if (x > (n - 1) / 2) x = n - x;
				cnt[x]++;
			}
		}
		for (int i = 1; i <= (n - 1) / 2; i++){
			printf("%d\n", cnt[i]);
		}
	}
	return 0;
}