#include <stdio.h>

int ans[10001];
int res[10001];

bool ck(int n,int mx){
	return n >= 0 && n <= mx;
}

int main(){
	int n;
	while(scanf("%d",&n), n != 0){
		int mx = (n-1)/2;
		for(int i = 0; i <= n;i++){
			ans[i] = 0;
			res[i] = 0;
		}
		for(int i = 1; i < n; i++){
			long long x = i * i;
			res[x%n]++;
		}
		for(int i = 1;i < n; i++){
			for(int j = i + 1;j < n; j++){
				int dif = i - j;
				while(!ck(dif,mx)){
					if(dif < 0){
						dif += n;
					}
					else if(dif > mx){
						dif = n - dif;
					}
				}
				ans[dif] += res[i] * res[j] > 0 ? 2 : 0;
			}
		}
		for(int i = 1; i <= mx; i++){
			printf("%d\n",ans[i]);
		}
	}

	return 0;
}

