#include<iostream>
#include<cmath>
#include<vector>
using namespace std;

#define MAX_N 100000

int q[MAX_N];
int x[MAX_N];
int n;
vector<int>p;

int main() {
	while (true) {
		for (int i = 0; i < MAX_N; i++) {
			q[i] = 0; x[i] = 0;
		}
		cin >> n;
		p.clear();
		if (n == 0) { break; }
		for (int i = 1; i < n; i++) {
			q[(i*i) % n]++;
		}
		for (int i = 1; i < n; i++) {
			if (q[i] >= 1) {
				p.push_back(i);
			}
		}
		for (int i = 0; i < p.size(); i++) {
			for (int j = 0; j < p.size(); j++) {
				int z;
				z = abs(n + p[i] - p[j]) % n;
				if (z > n / 2) { z = n - z; }
				x[z]++;
			}
		}
		for (int i = 1; i <= n / 2; i++) {
			cout << x[i] << endl;
		}
	}
}