#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <math.h>

using namespace std;

struct Info{
	int number;
};


void func(int n){

	int tmp,index = 0,firstCheck[10000],checkTable[10000];
	Info info[10000];

	for(int i = 0; i < 10000; i++)firstCheck[i] = 0;

	for(int i = 1; i <= n-1; i++){
		checkTable[i] = 0;
		tmp = (i*i)%n;

		if(firstCheck[tmp] == 0){
			info[index].number = tmp;
			index++;
			firstCheck[tmp] = 1;
		}
	}

	for(int i = 0; i < index; i++){
		for(int k = 0; k < index; k++){
			if(i != k){
				tmp = info[i].number - info[k].number;
				if(tmp < 0)tmp += n;
				if(tmp > (n-1)/2)tmp = n - tmp;
				checkTable[tmp]++;
			}
		}
	}

	int limit = (n-1)/2;

	for(int i = 1; i <= limit; i++)printf("%d\n",checkTable[i]);

}


int main(){

	int n;

	while(true){
		scanf("%d",&n);

		if(n == 0)break;

		func(n);
	}

    return 0;
}