#include <iostream>
#include <algorithm>

using namespace std;

int func(int s, int t, int m, int n)
{
	int v = s - t;
	
	if(v < 0){
		v += n;
	}
	if(v > m){
		v = n - v;
	}
	
	return v;
}

int main()
{
	int n, m, a[5001], p, b[10001], t;
	
	while(1){
		cin >> n;
		if(n == 0){
			break;
		}
		m = (n-1)/2;
		fill(a, a+m, 0);
		p = 0;
		for(int i = 1; i < n; i++){
			t = (i*i)%n;
			bool f = true;
			for(int j = 0; j < p; j++){
				if(t == b[j]){
					f = false;
					break;
				}
			}
			if(f){
				b[p++] = t;
			}
		}
		
		for(int i = 0; i < p-1; i++){
			for(int j = i+1; j < p; j++){
				a[func(b[i], b[j], m, n)]++;
				a[func(b[j], b[i], m, n)]++;
			}
		}
		for(int i = 1; i <= m; i++){
			cout << a[i] << endl;
		}
	}
	
	return 0;
}