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

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)

typedef vector<int> vi;

int main() {
	int n;
	while (cin >> n, n) {
		vi v;
		FOR(i, 1, n) v.push_back((i * i) % n);
		sort(v.begin(), v.end());
		v.erase(unique(v.begin(), v.end()), v.end());
		
		vi ans((n - 1) / 2 + 1, 0);
		REP(i, v.size()) REP(j, v.size()) if (i != j) {
			int x = v[i] - v[j];
			if (x < 0) x += n;
			if (x > (n - 1) / 2) x = n - x;
			ans[x]++;
		}
		FOR(i, 1, (n - 1) / 2 + 1) printf("%d\n", ans[i]);
		
	}
	return 0;
}