#include <cstring>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;

int main () {
	int n;
	while (cin >> n, n) {
		vector<int> rems;
		for (int i = 1; i < n; i++) {
			rems.push_back((i * i) % n);
		}
		sort(rems.begin(), rems.end());
		rems.erase(unique(rems.begin(), rems.end()), rems.end());
		vector<int> results((n - 1) / 2 + 1, 0);
		for (unsigned i = 0; i < rems.size(); i++) {
			for (unsigned j = 0; j < rems.size(); j++) {
				if (i == j) continue;
				int x = rems[i] - rems[j];
				if (x < 0) x += n;
				if ((n - 1) / 2 < x) x = n - x;
				results[x]++;
			}
		}
		for (unsigned i = 1; i < results.size(); i++) {
			cout << results[i] << endl;
		}
	}
	return 0;
}