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

int n;

int* cnt;

map<int,bool> memo;

int main(){
	while(true){
		cin >> n;
		if(!n)
			return 0;
		memo.clear();
		cnt = new int[(n+1)/2];
		for(int i=0; i<(n+1)/2; i++)
			cnt[i] = 0;
		for(int i=1; i<n; i++){
			int tmp = (i*i)%n;
			memo[tmp] = true;
		}
		for(int i=1; i<n-1; i++){
			if(!memo[i])
				continue;
			for(int k=i+1; k<n; k++){
				if(!memo[k])
					continue;
				int tmp = i - k;
				if(tmp < 0)
					tmp += n;
				if(tmp > n/2)
					tmp = n-tmp;
				cnt[tmp]++;
				tmp = k - i;
				if(tmp < 0)
					tmp += n;
				if(tmp > n/2)
					tmp = n-tmp;
				cnt[tmp]++;
			}
		}
		for(int i=1; i<(n+1)/2; i++)
			cout << cnt[i] << endl;
	}
}