#include <iostream>
#include <vector>
#include <queue>

using namespace std;

int main() {
	int n;
	while (cin >> n) {
		if (n == 0) {
			break;
		}
		priority_queue<int> pq;
		for (int i = 1; i < n; i++) {
			pq.push((i*i)%n);
		}
		int counter = 0;
		vector<int> hyou;
		while (!pq.empty()) {
			hyou.push_back(pq.top());
			pq.pop();
			counter++;
			while (!pq.empty()) {
				if (pq.top() == hyou[counter-1]) {
					pq.pop();
				} else {
					break;
				}
			}
		}
		vector<int> data(n+1, 0);
		int a;
		for (int i = 0; i < counter; i++) {
			for (int j = 0; j < counter; j++) {
				if (i == j) {
				} else {
					a = hyou[i]-hyou[j];
					if (a < 0) {
						a += n;
					}
					if (a > (n-1)/2) {
						a = n - a;
					}
					data[a]++;
				}
			}
		}
		for (int i = 1; i <= (n-1)/2; i++) {
			cout << data[i] << endl;
		}
	}
	return 0;
}