#include<iostream>
#include<map>
using namespace std;

int n;
int* cnt, *use;
int p;
map<int,bool> memo;

int main(){
	while(true){
		cin >> n;
		if(!n)
			return 0;
		memo.clear();
		p=0;
		cnt = new int[(n+1)/2];
		use = new int[n];

		for(int i=1; i<n; i++){
			int tmp = i*i%n;
			if(memo[tmp])
				continue;
			memo[tmp] = true;
			use[p++] = tmp;
		}

		for(int i=0; i<p-1; i++){
			for(int k=i+1; k<p; k++){
				int tmp = use[i]-use[k];
				if(tmp<0)
					tmp += n;
				if(tmp>(n-1)/2)
					tmp = n-tmp;
				cnt[tmp] += 2;
			}
		}

		for(int i=1; i<(n+1)/2; i++)
			cout << cnt[i] << endl;
	}
}