#include <iostream>
using namespace std;

int main()
{
	int n;
	while(cin >> n){
		if(n==0)
			break;
		int *n_num = new int[n];
		bool *is_n = new bool[n];
		for(int i=0;i<n;i++){
			is_n[i] = false;
		}
		for(int i=1;i<=(n-1)/2;i++){
			is_n[i*i%n] = true;
		}
		int a=0;
		for(int i=0;i<n;i++){
			if(is_n[i] == true){
				n_num[a++] = i;
			}
		}

		int *n_cou = new int[(n-1)/2+1];
		for(int i=1;i<=(n-1)/2;i++){n_cou[i] = 0;}

		for(int i=0;i<a;i++){
			for(int j=0;j<a;j++){
				int n_mem = (n_num[i]-n_num[j])%n;
				int tmp;
				do{
					tmp = n_mem;
					if(n_mem < 0)
						n_mem += n;
					if(n_mem > (n-1)/2)
						n_mem = n - n_mem;
				}while(tmp != n_mem);
				n_cou[n_mem]++;
			}
		}

		for(int i=1;i<=(n-1)/2;i++){
			cout << n_cou[i] << endl;
		}
		delete[] n_num;
		delete[] n_cou;
	}
	return 0;
}