#include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<vector>
#include<cstdlib>
#include<string>
#include<cstring>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<sstream>
using namespace std;

int N;

int calc(int a, int b){
	int res = a - b;
	if( res < 0 ) res += N;
	if( res > (N-1)/2 ) return res = N - res;
	return res;
}

int main(){
	while(cin >> N, N){
		int cnt[10000] = {};
		vector<int> s;
		for(int i = 1; i < N; i++){
			s.push_back( (i*i)%N );
		}
		sort( s.begin(), s.end() );
		s.erase( unique( s.begin(), s.end() ), s.end() );
		for(int i = 0; i < s.size(); i++){
			for(int j = 0; j < s.size(); j++){
				if( s[i] == s[j] ) continue;
				cnt[ calc(s[i], s[j]) ]++;
			}
		}
		for(int i = 1; i <= (N-1)/2; i++) printf("%d\n", cnt[i]);
	}
	return 0;
}