#include<iostream>
#include<map>
#define MAX 5001
using namespace std;
int main()
{
	while(true){
		int n;
		int c[MAX] = {0,};
		map<int,int> m;
		map<int,int>::iterator itm;

		cin >> n;
		if( n == 0 )break;

		for(int i = 1; i < n; ++i){
			m[(i*i)%n]=(i*i)%n;
		}

		itm = m.begin();
		while( itm != m.end() ){
			map<int,int>::iterator itm_t = m.begin();
			while( itm_t != m.end() ){
				if( itm_t != itm ){
					int diff = itm_t->second - itm->second;
					diff = diff < 0 ? diff + n : diff;
					diff = diff > (n-1)/2 ? n - diff : diff;
					++c[ diff ];	
				}
				++itm_t;
			}
			++itm;
		}
		for(int i = 1; i <= (n-1)/2; ++i){
			cout << c[i] << '\n';
		}
	}
	return 0;
}