#include <iostream>
#include <vector>
using namespace std;
#define rep2(x,from,to) for(int x=(from);x<(to);++(x))
#define rep(x,to) rep2(x,0,to)
int main() {
	int n;
	while(cin >> n, n) {
		if(n==1) {
			cout << 0 << endl;
			continue;
		}
		int a[10000]={};
		int c[5000]={};
		rep2(i,1,n) {
			a[(i*i)%n]++;
		}
		vector<int> v;
		rep2(i,1,n) {
			if(a[i]!=0) v.push_back(i);
		}
		rep(i,v.size()) {
			rep(j,v.size()) {
				if(i==j) continue;
				int s = v[i]-v[j];
				if(s<0) s+=n;
				if(s>(n-1)/2) c[n-s]++;
				else c[s]++;
			}
		}
		rep2(i,1,(n+1)/2) {
			cout << c[i] << endl;
		}
	}
	return 0;
}