#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int n;
int main() {
	while(scanf("%d", &n), n) {
		vector<int> v1, v2;
		for(int i = 1; i < n; i++) v1.push_back(i * i % n);
		sort(v1.begin(), v1.end());
		v2.push_back(v1[0]);
		for(int i = 1; i < v1.size(); i++) {
			if(v1[i - 1] != v1[i]) v2.push_back(v1[i]);
		}
		vector<int> a(n / 2);
		for(int i = 0; i < v2.size(); i++) {
			for(int j = i + 1; j < v2.size(); j++) {
				int r = v2[j] - v2[i];
				if(r < 0) r += n;
				if(r > n / 2) r = n - r;
				a[r - 1]++;
			}
		}
		for(int i = 0; i < n / 2; i++) printf("%d\n", a[i] * 2);
	}
}