#include <iostream>
#include <algorithm>

using namespace std;

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++){
				t = b[j] - b[i];
				if(t < 0){
					t += n;
				}
				if(t > m){
					t = n - t;
				}
				a[t] += 2;
			}
		}
		for(int i = 1; i <= m; i++){
			cout << a[i] << endl;
		}
	}
	
	return 0;
}